【发布时间】:2013-05-16 14:13:24
【问题描述】:
我在这个 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 语句可以正常工作。
感谢您的帮助
【问题讨论】:
标签: iphone ios objective-c nsstring