我有这段代码,需要获取键值nombre并填充 NSArray *array 但不起作用
NSURL *urlPaises = [NSURL URLWithString:@"http://tr.com.mx/prb2/buscarPais.php"];
NSData *dataPaises = [NSData dataWithContentsOfURL:urlPaises];
NSArray *array;
NSMutableDictionary *jsonPaises;
NSError *error;
array = [[NSArray alloc]init];
jsonPaises = [NSJSONSerialization JSONObjectWithData:dataPaises options:kNilOptions error:&error];
array = [jsonPaises objectForKey: @"nombre"];
Printing description of self->jsonPaises:
{
paises = (
{
id = 49;
nombre = Alemania;
},
{
id = 54;
nombre = Argentina;
},
{
id = 44;
nombre = Inglaterra;
},
{
id = 598;
nombre = Uruguay;
},
{
id = 58;
nombre = Venezuela;
}
);
}