According to your picture Missions
is a dictionary rather than an array. So you need to read them differently.
NSDictionary *plistDict = ...;
NSDictionary *missions = [plistDict objectForKey:@"Missions"];
[missions enumerateKeysAndObjectsUsingBlock:^(NSString *key, NSDictionary *mission, BOOL *stop) {
NSString *missionName = [mission objectForKey:@"mission name"];
NSNumber *available = [mission objectForKey:@"Available"];
NSLog(@"Mission: %@, Name = %@, Available = %@", key, missionName, available);
}];
Note that you won't necessarily get the missions back in the same order as they are defined in the dictionary. Therefore you also can't get the index. If you need to know the index, you need to change the Missions
object to an array instead in the plist.
Also note that Available
is defined as boolean
in your plist, therefore you should store the value in an NSNumber
.