为什么MFMailComposeViewController在iOS8.3上会崩溃?[英] Why is MFMailComposeViewController crashing on iOS 8.3?

本文是小编为大家收集整理的关于为什么MFMailComposeViewController在iOS8.3上会崩溃?的处理方法,想解了为什么MFMailComposeViewController在iOS8.3上会崩溃?的问题怎么解决?为什么MFMailComposeViewController在iOS8.3上会崩溃?问题的解决办法?那么可以参考本文帮助大家快速定位并解决问题。

问题描述

我最近提交了一个供审核的应用,在发送电子邮件链接时崩溃了.我尝试了多次使用多个设备,并且无法重新创建它,但没有iPad Air 2.但是,它看起来好像可能与没有包含支票 [ MFMailComposeViewController canSendMail] ,虽然我不确定这是否会导致崩溃.任何人都可以提供一些有关崩溃原因的见解吗?谢谢!



在审核过程中,您的应用程序在运行iOS 8.3的iPad Air 2上崩溃了,我们:
1.按提供反馈按钮



以下是错误日志:



 例外类型:EXC_CRASH(SIGABRT)
异常码:0x0000000000000000,0x0000000000000000
触发的帖子:

上次异常回溯:
(0x1839bc2d8 0x1950dc0e4 0x18871ea98 0x188720934 0x1884ea158 0x1000bc128 0x188431404 0x18841a4e0 0x188430da0 0x188430a2c 0x188429f68 0x1883fd18c 0x18869e324 0x1883fb6a0 0x183974240 0x1839734e4 0x183971594 0x18389d2d4 0x18cf8b6fc 0x188462fac 0x1000bc6f0 0x19575aa08)

线程0名称:调度队列:com.apple.main-thread
线程0崩溃:
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 {
//电子邮件主题t
NSString * emailTitle = @"iOS App Feedback";
//电子邮件内容
NSString * messageBody = @"在此处输入消息";
//要解决
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];

//屏幕上显示邮件视图控制器
[self presentViewController:mc animated:YES completion:NULL];
}


- (void)mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)结果错误:(NSError *)错误
{
switch(result)
{
case MFMailComposeResultCancelled:
NSLog(@"Mail cancellation");
休息;
case MFMailComposeResultSaved:
NSLog(@"Mail saved");
休息;
case MFMailComposeResultSent:
NSLog(@"Mail sent");
休息;
case MFMailComposeResultFailed:
NSLog(@"Mail sent failure:%@",[error localizedDescription]);
休息;
默认值:
break;
}

//关闭邮件界面
[self dismissViewControllerAnimated:YES completion:NULL];
}

推荐答案

在iPhone上书写,请原谅.保留对邮件控制器的强引用,直到最终委托回调.


本文地址:https://www.itbaoku.cn/post/924623.html