【发布时间】:2013-08-13 12:58:02
【问题描述】:
我在将对象的 id 转换为 int(或 NSINteger)时遇到了麻烦,以便以后可以在循环中使用它。
情况如下:
// "tasks" is a mutable array
int taskNo = [[tasks indexOfObject:@"something"] integerValue];
但结果是:
Bad receiver type 'NSUInteger' (aka 'unsigned int')
我发现了一个类似的线程,其代码类似于我上面的代码,但不幸的是它对我不起作用。我想我一定错过了一些简单的东西。
非常感谢!
【问题讨论】:
标签: ios casting type-conversion