JohnPortella
JohnPortella

Reputation: 1821

NSDICTIONARY with multiple keys

I have a NSDICTIONARY :

(
    {
      Edad = 11;
      Genero = M;
      IdArea = 1;
      IdEmpleado = 11;
      Nombre = Manuel;
    },
    {
      Edad = 30;
      Genero = M;
      IdArea = 2;
      IdEmpleado = 2;
      Nombre = Luis;
    }

)

How I can do to separate the data in quotes?, To find the values ​​for keys.

       {
          Edad = 11;
          Genero = M;
          IdArea = 1;
          IdEmpleado = 11;
          Nombre = Manuel;
        }

         objectforkey @"genero" = M

thanks for the help

Upvotes: 1

Views: 316

Answers (1)

Gypsa
Gypsa

Reputation: 11314

From the data structure you posted :-

It is array which contains number of dictionaries.

Now for extracting values for particular key you need to do is:-

Suppose DataArray is the array which holds your data. Now

for (int i=0; i<[self.DataArray count]; i++) 
{

NSDictionary *dict=[self.DataArray objectAtIndex:i];
NSString *genreString=[dict objectForKey:@"genero"];
}

Upvotes: 2

Related Questions