Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/95.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 发送电子邮件导致-连接中断_Ios_Objective C_Xcode_Ios8_Mfmailcomposeviewcontroller - Fatal编程技术网

Ios 发送电子邮件导致-连接中断

Ios 发送电子邮件导致-连接中断,ios,objective-c,xcode,ios8,mfmailcomposeviewcontroller,Ios,Objective C,Xcode,Ios8,Mfmailcomposeviewcontroller,基本上,我想做的是发送电子邮件: -(void) sendAnEmail { if ([MFMailComposeViewController canSendMail]) { MFMailComposeViewController *mail = [[MFMailComposeViewController alloc] init]; mail.mailComposeDelegate = self; [mail setSubject

基本上,我想做的是发送电子邮件:

-(void) sendAnEmail {

    if ([MFMailComposeViewController canSendMail])
    {
        MFMailComposeViewController *mail = [[MFMailComposeViewController alloc] init];
        mail.mailComposeDelegate = self;
        [mail setSubject:@"Subject"];
        [mail setMessageBody:@"Hey, check this out!" isHTML:NO];
        [mail setToRecipients:@[@"testing@gmail.com"]];

        [self presentViewController:mail animated:YES completion:NULL];
    }
    else
    {
        NSLog(@"device cannot send email");
    }
}
没有错误,没有警告。如果该空区为:

收到消息的BSXPCMessage错误:连接中断

我如何解决这个问题?

试验装置-5S(8.3)

  • 从中我可以理解,XPC服务应该通过某种方式分离不稳定的组件来防止应用程序崩溃

  • 崩溃本身是由CIFilter中的某种错误引起的。 很难判断代码到底出了什么问题,因为问题显然不在
    MFMailComposeViewController
    上。如果您正在使用以下选项创建
    CIContext


  • 尝试将
    替换为

    这段代码是否真的被调用了?您是否在附近的某个地方对CIFilter进行了任何操作?我正试图发送一封带有附件的电子邮件,出现了相同的问题,因此我尝试了一些简单的方法,这是实际情况code@alexburtnikwtf非常感谢你的提示-你太棒了:D你能在回答中解释为什么会发生这种情况吗?我会把它标记为正确的
    [CIContext contextWithOptions: @{kCIContextUseSoftwareRenderer : @(NO)}];