2015-03-31 91 views
2

爲什麼只會在具有8.2的設備上崩潰?在其他版本的工作得很好,甚至有8.2優良工程模擬器......MFMailComposeViewController在設備上崩潰8.2

var mailPicer = MFMailComposeViewController() 
    mailPicer.mailComposeDelegate = self 
    mailPicer.setCcRecipients(["[email protected]"]) 
    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) 

我沒有得到任何日誌崩潰,以及...

有什麼想法?

+0

訪問從Xcode的設備窗口設備上的崩潰日誌,看看故障轉儲告訴你。 – 2015-03-31 11:08:17

+0

好,我一定是緩慢的今天:)這是日誌 異常類型:EXC_CRASH(SIGABRT) 異常代碼:0x0000000000000000,0x0000000000000000 觸發通過主題:0 上次異常回溯: 0的CoreFoundation \t 0x1823b6530 __exceptionPreprocess + 132 1 libobjc.A.dylib \t 0x1933400e4 objc_exception_throw + 60 2 UIKit的\t 0x186edb0cc - [UIViewController中_presentViewController:withAnimationController:完成:] + 3376 – Waylli 2015-03-31 11:18:18

+1

正如我今天慢以前說過....很抱歉的職位,我didn't檢查 如果MFMailComposeViewController .canSendMail()...... – Waylli 2015-03-31 11:33:54

回答

1

檢查if MFMailComposeViewController.canSendMail()

0

執行你的應用程序的其餘部分之前補充一點:

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