我在这个 NSString 中下面代码的第一行的 switch 语句中收到“预期表达式”错误:NSString *emailTitle = @"some text";
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 语句可以正常工作。
谢谢你的帮助