为什么MFMailComposeViewController在iOS 8.3上崩溃?

我最近提交了一个应用程序进行审查,当一个电子邮件链接出现时,这个应用程序崩溃了。 我多次尝试过使用多个设备,但无法重新创build它,但没有iPad Air 2.但是,看起来好像它可能不包含[MFMailComposeViewController canSendMail]的检查,尽pipe我我不确定这是否会导致崩溃。 任何人都可以提供一些见解,为什么它坠毁? 谢谢!

在审查期间,当我们执行以下操作时,您的应用程序会在运行iOS 8.3的iPad Air 2上崩溃:1.按提供反馈button

这里是错误日志:

 Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Triggered by Thread: 0 Last Exception Backtrace: (0x1839bc2d8 0x1950dc0e4 0x18871ea98 0x188720934 0x1884ea158 0x1000bc128 0x188431404 0x18841a4e0 0x188430da0 0x188430a2c 0x188429f68 0x1883fd18c 0x18869e324 0x1883fb6a0 0x183974240 0x1839734e4 0x183971594 0x18389d2d4 0x18cf8b6fc 0x188462fac 0x1000bc6f0 0x19575aa08) Thread 0 name: Dispatch queue: com.apple.main-thread Thread 0 Crashed: 0 libsystem_kernel.dylib 0x0000000195873270 0x195858000 + 111216 1 libsystem_pthread.dylib 0x000000019591116c 0x19590c000 + 20844 2 libsystem_c.dylib 0x00000001957eab14 0x195788000 + 404244 3 libc++abi.dylib 0x00000001948a9414 0x1948a8000 + 5140 4 libc++abi.dylib 0x00000001948c8b88 0x1948a8000 + 134024 5 libobjc.A.dylib 0x00000001950dc3bc 0x1950d4000 + 33724 6 libc++abi.dylib 0x00000001948c5bb0 0x1948a8000 + 121776 7 libc++abi.dylib 0x00000001948c5738 0x1948a8000 + 120632 8 libobjc.A.dylib 0x00000001950dc290 0x1950d4000 + 33424 9 CoreFoundation 0x000000018389d380 0x183894000 + 37760 10 GraphicsServices 0x000000018cf8b6f8 0x18cf80000 + 46840 11 UIKit 0x0000000188462fa8 0x1883ec000 + 487336 12 b2bGatewayWebview 0x00000001000bc6ec 0x100098000 + 149228 13 libdyld.dylib 0x000000019575aa04 0x195758000 + 10756 

代码:

 - (IBAction)touchRequestEnhancement:(id)sender { // Email Subject NSString *emailTitle = @"iOS App Feedback"; // Email Content NSString *messageBody = @"Enter message here"; // To address NSArray *toRecipents = [NSArray arrayWithObject:@"xxxx@xxxx.com"]; 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]; } - (void) mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error { switch (result) { case MFMailComposeResultCancelled: NSLog(@"Mail cancelled"); break; case MFMailComposeResultSaved: NSLog(@"Mail saved"); break; case MFMailComposeResultSent: NSLog(@"Mail sent"); break; case MFMailComposeResultFailed: NSLog(@"Mail sent failure: %@", [error localizedDescription]); break; default: break; } // Close the Mail Interface [self dismissViewControllerAnimated:YES completion:NULL]; } 

在iPhone上写作,所以请原谅。 保持对邮件控制器的强烈引用,直到最终的代表callback。