我有一个正在运行的应用程序,我即将分发并正在整理其中的NSLog语句。当我从“case”语句中删除NSLog时,NSArray在“case”语句内声明错误,并在之前和未声明的预期表达式中声明错误。任何人都知道为什么这可能是?这发生在我现在删除NSLog的应用中的所有case语句中。 一个例子代码段如下所示:删除NSLog的IPhone SDK导致NSArray未声明!
switch (chosenScene)
{
case 0:
//NSLog(@"group1"); // the following NSArray errors with "expected expression.." AND "..group1Secondsarray undeclared"
NSArray *group1SecondsArray = [NSArray arrayWithObjects: @"Dummy",@"1/15",@"1/30",@"1/30",@"1/60",@"1/125",@"1/250",nil];
NSArray *group1FStopArray = [NSArray arrayWithObjects: @"Dummy",@"2.8",@"2.8",@"4",@"5.6",@"5.6",@"5.6",nil];
NSString *group1SecondsText = [group1SecondsArray objectAtIndex:slider.value];
calculatedSeconds.text = group1SecondsText;
NSString *group1FStopText = [group1FStopArray objectAtIndex:slider.value];
calculatedFStop.text = group1FStopText;
[group1SecondsText release];
[group1FStopText release];
break;
这很棒,解决了我的问题。感谢您的快速回复, – 2010-02-07 09:49:39
Maxwell Segal - 如果这是答案,请打上旁边的复选标记,以便系统知道问题已得到解答,并让Eyal Redler获得相应的奖励。 – TechZen 2010-02-07 14:52:50