【发布时间】:2010-02-07 08:59:45
【问题描述】:
我有一个正在运行的应用程序,我将要分发并整理其中的 NSLog 语句。当我从“case”语句中删除 NSLog 时,在“case”语句中声明的 NSArray 错误为 AND 未声明之前的预期表达式。有人知道为什么会这样吗?这发生在我现在删除 NSLog 的应用程序中的所有 case 语句中。 示例代码部分如下所示:
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;
【问题讨论】: