Method to get a value from plist

cocos2d-iphone, ios, plist, properties

Solution

Try this:

NSString *path = [[NSBundle mainBundle] pathForResource:@"PlistX" ofType:@"plist"];
NSDictionary *dict = [[NSDictionary alloc] initWithContentsOfFile:path];
int number = [[[[dict objectForKey:@"One"] objectForKey:@"Two"]objectForKey:@"Three"] intValue];
NSLog(@"%d",number);    

Problem

I have a integer called NumberX and a plist called PlistX. Example ``` int NumberX; ``` PlistX: I was wondering how I'd make NumberX = value of Three

Original source