1
我下面的代碼在這個NSString的第一行收到「預期的表達」錯誤的switch語句:NSString *emailTitle = @"some text";
如何修復switch語句中的NSString預期表達式錯誤?
break;
case 4:
// mail
// Email Subject
NSString *emailTitle = @"some text";
// Email Content
NSString *messageBody = @"http://www.example.com/";
// To address
NSArray *toRecipents = [NSArray arrayWithObject:@""];
MFMailComposeViewController *mc = [[MFMailComposeViewController alloc] init];
mc.mailComposeDelegate = self;
[mc setSubject:emailTitle];
[mc setMessageBody:messageBody isHTML:NO];
[mc setToRecipients:toRecipents];
// Present mail view controller on screen
[self presentViewController:mc animated:YES completion:NULL];
break;
case 5:
如果沒有這一塊的郵件代碼switch語句工作正常。
感謝您的幫助