MFMailComposeViewController在设备8.2上崩溃

时间:2015-03-31 11:03:11

标签: ios swift email-integration mfmailcomposer

为什么仅在8.2的设备上崩溃?在其他版本上工作得很好,甚至在模拟器上8.2工作正常......

var mailPicer = MFMailComposeViewController()
    mailPicer.mailComposeDelegate = self
    mailPicer.setCcRecipients(["bla@dad.com"])
    mailPicer.setEditing(true, animated: true)
    mailPicer.setSubject("I have something to tell you")
    mailPicer.setMessageBody("bla bbla`", isHTML: true)
    self.presentViewController(mailPicer, animated: true, completion: nil) 

我也没有得到崩溃的任何日志......

有什么想法吗?

2 个答案:

答案 0 :(得分:1)

检查if MFMailComposeViewController.canSendMail()

答案 1 :(得分:0)

在执行应用的其余部分之前添加此内容:

if(!MFMailComposeViewController.canSendMail()) {
    // show user a message f.e.
    return
}