Currently using cocos2d. I have a plist data name myplist.plist. Inside the plist are all integers.. How do i read the data and the int in 开发者_JAVA百科it?
NSString *path = [[NSBundle mainBundle] bundlePath];
NSString *dictionaryPath = [path stringbyAppendingPathComponent:@"myplist.plist"];
NSDictionary *integerDictionary = [[NSDictionary alloc] initWithContentsOfFile:dictionaryPath];
int myInteger1 = [[integerDictionary objectForKey:@"integer1"] intValue];
int myInteger2 = [[integerDictionary objectForKey:@"integer2"] intValue];
// etc etc
精彩评论