0

In the file there are 9 dictionaries each with two keys. I want to obtain an array of dictionary.I get that array elements are: 0 This is the code:

NSString * path = [[NSBundle mainBundle]pathForResource:@"List" ofType: @"plist"];

 NSArray *array = [NSArray arrayWithContentsOfFile:path];  

Thanks in advance

Ortensia C.
  • 4,666
  • 11
  • 43
  • 70

1 Answers1

0
NSString *file = [[NSBundle mainBundle] pathForResource:@"List" ofType:@"plist"];
NSDictionary *dict = [NSDictionary dictionaryWithContentsOfFile:file];
NSArray *array = [dict objectForKey:@"Array"];

Hope this helps

Your plist is an dictionary not an array. So check this out.

DivineDesert
  • 6,924
  • 1
  • 29
  • 61