iPhone 용 앱을 만들 때 Xcode 컴파일러에 이상한 오류가 나타납니다. 내가 오류는 다음과 같습니다iOS - 부당한 문자가 예상됩니다.
Expected ']'
- (IBAction)backButton:(id)sender
{
NSUserDefaults* standardUserDefaults = [NSUserDefaults standardUserDefaults];
if(standardUserDefaults)
{
NSString* isNewNote = [standardUserDefaults objectForKey:@"newNote"]; // here is the error
if(isNewNote isEqualToString:@"Yes")
{
[noteList removeObjectAtIndex:currentNote];
[noteContent removeObjectAtIndex:currentNote];
}
}
NSString* storyboardName = @"Main";
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle: nil];
UIViewController * vc = [storyboard instantiateViewControllerWithIdentifier:@"ViewController"];
[self presentViewController:vc animated:NO completion:nil];
}
당신이 무슨 잘못 알아낼 수 있습니까? 감사.
'(isNewNote isEqualToString : "예"@)의 경우'-이 엑스 코드는 어떤 오류가 켜져있는 줄을 말 했는가? – Douglas
예. NSString * isNewNote = [standardUserDefaults objectForKey : @ "newNote"]; // 여기에 오류가 있습니다. ' – Sam