我有一个问题,我如何计算我的 plist 文件中的项目。我试过了:
NSString *bundlePathofPlist = [[NSBundle mainBundle]pathForResource:@"Mything" ofType:@"plist"];
NSDictionary *dict = [NSDictionary dictionaryWithContentsOfFile:bundlePathofPlist];
NSArray *dataFromPlist = [dict valueForKey:@"some"];
for(int i =0;i<[dataFromPlist count];i++)
{
//NSLog(@"%@",[dataFromPlist objectAtIndex:i]);
[self setTableData:[dataFromPlist count]];
}
NSLog(@"%@", tableData);
但在这一行出现错误:
[self setTableData:[dataFromPlist count]];
Implicit conversion of 'NSUInteger' (aka 'unsigned int') to 'NSArray *' is disallowed with ARC
和警告:
Incompatible integer to pointer conversion sending 'NSUInteger' (aka 'unsigned int') to parameter of type 'NSArray *';