2
我有开关。其中一个案件必须是阵列的计数:如何将[数组数]粘贴到大小写:
int count = [array count];
switch (someValue) {
case 0:
[self foo];
break;
case count:
[self bar];
break;
default:
break;
}
但是编译器tolds:
Expression is not an integer constant expression
如何使const int的从[数组数]?
不可能。开关不能这样工作,你必须创建自己的开关式控制结构(如果你愿意,我可以这样做)。 – 2012-07-25 15:39:14
不需要,谢谢。 – Moonkid 2012-07-25 15:50:54