我有一个名为NumberX的整数和一个名为PlistX的plist.
例
int NumberX;
PlistX:
我想知道我如何使NumberX =值为3
解决方法
试试这个:
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);