我正试图从plist获取整数的值。
NSString *path = [[NSBundle mainBundle] pathForResource:@"Prop" ofType:@"plist"];
NSDictionary *dict = [[NSDictionary alloc] initWithContentsOfFile:path];
int number = [[[dict objectForKey:@"Root"] objectForKey:@"Quant"] intValue];
NSLog(@"Quant is %d",number);
plist:
<dict>
<key>Quant</key>
<integer>5</integer>
</dict>
应用程序运行,但数字的值始终为0.
我整天都在阅读各种手册,但找不到错误。