Creating an Array with the Keys of a Dictionary

1

I have a dictionary according to the image below and I would like to play the names of the dictionary keys medicaments for an array, how I can accomplish this function

    
asked by anonymous 12.05.2014 / 19:23

2 answers

3

NSDictionary has method - (NSArray *)allKeys that returns an array containing all the keys of the dictionary

    
12.05.2014 / 21:30
0
NSString * path= [[NSBundle mainBundle]pathForResource:@"Medicamentos" ofType:@"plist"];

    NSDictionary * dadosArquivo =[NSDictionary dictionaryWithContentsOfFile:path];

    NSArray * medicamentos =[dadosArquivo objectForKey:@"medicamentos"]; //

   NSLog(@"%@", medicamentos);

I think that's it.

    
23.07.2014 / 21:09