2011-08-03 3 views
0

を投げ、私は文は、それがコンパイルに失敗した場合、私は無用を削除すると奇妙な問題iOSのXcodeの:エラー

case 5: 
     if(1==2) {NSLog(@"Here is a tmp stuff");} 
     AuthenticationViewController *authVC = [[AuthenticationViewController alloc] initWithNibName:@"AuthenticationViewController" bundle:[NSBundle mainBundle]]; 
     [authVC setTitle:@"Authentication"]; 
      //self.authViewController = authVC; 
      //[authVC release]; 

     [self.navigationController pushViewController:authVC animated:YES]; 

     break; 

に走りました。私はなぜ理解できないのですか?

+0

AuthenticationViewControllerを作成し、右、プッシュされますか? – tipycalFlow

+0

はい、アファーマムは正しく答えています。 case文は、コンパイラがスコープを認識していないというラベルの束です。 {}内のすべてのものをラップすると、スコープが定義され、動作します。 –

答えて

関連する問題