我有开关。其中一种情况必须是数组计数:
int count = [array count];
switch (someValue) {
case 0:
[self foo];
break;
case count:
[self bar];
break;
default:
break;
}
但编译器告诉:
Expression is not an integer constant expression
如何从 [array count] 生成 const int?