2
當前正在使用cocos2d。我有一個plist數據名稱myplist.plist。在plist裏面都是整數。我如何讀取數據和int?如何讀取plist數據並從中獲取int?
當前正在使用cocos2d。我有一個plist數據名稱myplist.plist。在plist裏面都是整數。我如何讀取數據和int?如何讀取plist數據並從中獲取int?
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
yupz ..它的工作..謝謝.. – xuanweng 2011-02-18 04:32:52