Format指定类型'unsigned int'但参数的类型为'id'

时间:2013-02-15 09:43:36

标签: objective-c warnings

NSString *val = [NSString stringWithFormat:@"%u",[settingsMgr performSelector:NSSelectorFromString([[gets objectAtIndex:indexPath.section] objectAtIndex:indexPath.row])]];

在上面的代码中,我收到一条警告,其中settingsMgr是对象类,而getsNSMutableArray

1 个答案:

答案 0 :(得分:0)

NSMutableArray不能保存标准类型(int,float,BOOL等),因此它们被包装存储(主要在NSNumber中)。尝试将%u更改为%@