gpt4 book ai didi

ios - MFMailComposeViewController 仅在 iOS 9 中抛出错误

转载 作者:IT王子 更新时间:2023-10-29 08:06:08 27 4
gpt4 key购买 nike

如果不在 iOS 9 模拟器中引发 fatal error ,我无法打开 MFMailComposeViewController。

相同的代码( Objective-C )在 iOS 8.x 及更低版本中完美运行,但今天我安装了 Xcode 7 beta 5,当我在 iOS 9 模拟器上运行该应用程序时,我收到一个名为“MailCompositionService 意外退出”的对话框,并且当我查看错误报告时,我看到:

Application Specific Information:*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSArrayI isEqualToString:]: unrecognized selector sent to instance 0x7fd314280b10'

terminating with uncaught exception of type NSExceptionabort() calledCoreSimulator 179 - Device: iPhone 6 - Runtime: iOS 9.0 (13A4325c) - DeviceType: iPhone 6

错误发生在邮件撰写 View 出现时。它卡住了几秒钟,然后出现错误对话框。

打开邮件撰写 View 的代码是:

if ([MFMailComposeViewController canSendMail])
{
MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
picker.mailComposeDelegate = self;
[picker setSubject:@"Comment title"];
[picker setMessageBody:@"Comment description" isHTML:NO];

[self.window.rootViewController presentModalViewController:picker animated:YES];
[picker release];
}

如果有助于了解,在应用程序崩溃之前,调用 mailComposeController:didFinishWithResult:error:result = MFMailComposeResultCancelled错误 =

我很感激有关如何查找此错误原因的提示。谢谢!

最佳答案

问题出在模拟器上,在真实设备上邮件编辑器工作正常。

关于ios - MFMailComposeViewController 仅在 iOS 9 中抛出错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32078073/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com