MFMailComposeInternalViewController中的断言失败 - 应该有延迟呈现

时间:2014-10-24 18:47:38

标签: ios mfmailcomposeviewcontroller

在使用RESideMenu并尝试发送邮件时,我设法在iOS8.1中发现了一个错误。

我使用样板MFMailComposer代码(在普通项目中工作正常),但在RESideMenu下调用时似乎会中断。

尝试在iPhone6和iPhone5上的ObjC和Swift中的下面(功能完全没有RESideMenu)代码,没有变化。

 var mc: MFMailComposeViewController!
func shareTest()
{
        if MFMailComposeViewController.canSendMail()
        {
            mc = MFMailComposeViewController()
            mc.setSubject("subject")
            mc.setToRecipients(["me@me.com"])
            mc.setMessageBody("...", isHTML: false)
            mc.mailComposeDelegate = self 
            self.presentViewController(mc, animated: true, completion: nil)
        }
}

func mailComposeController(controller: MFMailComposeViewController!, didFinishWithResult result: MFMailComposeResult, error: NSError!) {
    self.dismissViewControllerAnimated(true, completion: nil)

}

断言文本是:

  

***断言失败 - [MFMailComposeInternalViewController _endDelayingCompositionPresentation],/ SourceCache / MessageUI / MessageUI-1466.1.2 / Mail / WMFailComposeInternalViewController.m:322

     

***由于未捕获的异常终止应用程序' NSInternalInconsistencyException',原因:'应该有延迟的演示'

在dispatch_after~5 - 10秒内调用presentViewController并不是'解决问题。 Netiher确实从根视图控制器而不是当前控制器调用它。

此外,搜索"应该延迟演示"谷歌没有任何东西。

1 个答案:

答案 0 :(得分:0)

回过头来发布我的"解决方案"因为我在RESideMenu repo被提醒了这一点,并且没有听到任何回应。

经过多次调试我自己的代码,结果发现问题出在我正在使用的库中。

我从RESideMenu切换到SWReveal,之后 - MFMailComposer或导出没有问题,所以RESideMenu中似乎有一个未解决的错误。