aku*_*tsu 6 properties plist cocos2d-iphone ios
我有一个名为NumberX的整数和一个名为PlistX的plist.
例
int NumberX;
Run Code Online (Sandbox Code Playgroud)
PlistX:

我想知道我如何使NumberX =值为3
Hec*_*tor 15
试试这个:
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);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
9896 次 |
| 最近记录: |