I am trying to get an array inside an NSMutableDictionary that looks like this:
{
coments = (
);
"foto_user" = "<null>";
fotos = (
{
fecha = "2012-08-31 19:44:31";
id = 4926;
nombre = "image5773.jpg";
posicion = 0;
ruta = "img/";
tipo = 1;
},
{
fecha = "2012-08-31 19:44:31";
id = 4927;
nombre = "image1779.jpg";
posicion = 0;
ruta = "img/";
tipo = 1;
},
{
fecha = "2012-08-31 19:44:31";
id = 4928;
nombre = "image5938.jpg";
posicion = 0;
ruta = "img/";
tipo = 1;
},
{
fecha = "2012-08-31 19:44:32";
id = 4929;
nombre = "image4424.jpg";
posicion = 0;
ruta = "img/";
tipo = 1;
}
);
"have_coments" = 0;
id = 40505;
"id_lugar" = "<null>";
"id_pais" = 28;
"id_user" = "<null>";
iso = fr;
link = "<null>";
lugar = Paris;
"nombre_pais" = "France";
root = "http://www.domain.com/";
tags = (
);
titulo = "Sunset";
"url_share" = "http://www.friktrip.com/experiencia/40505";
videos = (
);
}
And I use this code:
NSMutableArray *foto = [[NSMutableArray alloc]init];
foto = [OnlineObjects objectAtIndex:1];
But the "fotoarray" array remains empty, trying to get information from NSMutableArray.
NSArray *fotoarray = [foto valueForKey:@"nombre"];
How to create an array with all objects named "nombre"?
source
share