我有一个问题,我可以如何计算我的plist文件中的项目。我想:如何计算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 *';
@Popeye谢谢你删除不必要的[xcode]标签。 – vikingosegundo 2012-08-13 22:41:27
@vikingosegundo即使我删除了它,我也确信它已被Frenck添加回来。 – Popeye 2012-08-14 08:13:26
@Frenck请不要再添加Xcode标签。对于这个问题,这是无关紧要的。它只会产生混乱和噪音。 – vikingosegundo 2012-08-14 11:25:23