我得到一個錯誤,在我的switch語句與一些多線Objective-C代碼:的Objective-C格式樣式引起的開關情況下的錯誤
- (void)mailComposeController:(MFMailComposeViewController*)controller
didFinishWithResult:(MFMailComposeResult)result
error:(NSError*)error
{
// Notifies users about errors associated with the interface
switch (result)
{
case MFMailComposeResultCancelled:
break;
case MFMailComposeResultFailed:
// NSLog(@"Mail Failed");
UIAlertView *alert = [[UIAlertView alloc]
initWithTitle:NSLocalizedString(@"Error", @"Error")
message:[error localizedDescription]
delegate:nil
cancelButtonTitle:NSLocalizedString(@"OK", @"OK")
otherButtonTitles:nil];
[alert show];
[alert release];
break;
default:
break;
}
}
如果我取消了符合NSLog
,它工作正常。什麼導致這個錯誤?有什麼方法可以使用這種格式?
感謝您的回答。與格式無關,而是聲明。 – 2010-07-10 15:35:18