Hy guys,
我现在为自己的故事跑了4个小时,我才意识到也许我不是疯了或愚蠢而邮件作曲家在iOS8.1中不起作用
所以这是我的代码,没什么特别的:
MFMailComposeViewController *mail = [[MFMailComposeViewController alloc] init];
mail.mailComposeDelegate = self;
if ([MFMailComposeViewController canSendMail]) {
//Setting up the Subject, recipients, and message body.
[mail setToRecipients:[NSArray arrayWithObjects:@"email@email.com",nil]];
[mail setSubject:@"Subject of Email"];
[mail setMessageBody:@"Message of email" isHTML:NO];
//Present the mail view controller
[self presentViewController:mail animated:YES completion:NULL]; }
在iOS 8.1中,我收到了主题和应用程序崩溃的邮件窗口。
在iOS 7.1中,我收到了包含主题和邮件正文的邮件窗口,一切都很好。
我在iOS8.1中缺少某些东西,或者这是一个错误?
谢谢
PS:崩溃是因为它无法完成收件人或邮件正文的电子邮件。这是崩溃报告的一部分:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSRegularExpression enumerateMatchesInString:options:range:usingBlock:]: nil argument' terminating with uncaught exception of type NSException abort() called CoreSimulator 110.4 - Device: iPhone 5 - Runtime: iOS 8.1 (12B411) - DeviceType: iPhone 5
或者:
<MFMailComposeRemoteViewController: 0x7c0c1e00> timed out waiting for fence barrier from com.apple.MailCompositionService
我导入了框架,标题并完成了委托。