swift - 警告 : Attempt to present <MFMailComposeViewController: - Swift

标签 swift email warnings

这是我的问题。我有 MainViewController 和 MenuViewController。当我转到 MenuViewController 时,我可以在多个操作之间进行选择。其中之一是电子邮件编辑器。当我单击该按钮时,MenyViewController 消失,MainViewController 出现,然后我等待电子邮件 View Controller ,但它没有显示。我收到此错误

Warning: Attempt to present <MFMailComposeViewController: 0x15f0ef000> on <app.MainViewController: 0x15e6d9090> while a presentation is in progress!

我明白原因,但我无法修复它。我尝试使用 NSTimer 推迟电子邮件撰写 View Controller 的演示,并且它有效。

最佳答案

遇到了类似的问题,重复的评论没有帮助,因为我无权访问先前的 View Controller ,认为这可能对其他人有帮助。

(我的 Objective-C 解决方案)

dispatch_async(dispatch_get_main_queue(), ^ {
    //present view controller
});

关于swift - 警告 : Attempt to present <MFMailComposeViewController: - Swift,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35845936/

相关文章:

swift - 无法将类型 'Swift._NSContiguousString' 的值转换为“NSNumber”

android - 闪烁的电子邮件选择器

rest - 微服务架构中的电子邮件发送

带指针的 const 结构,丢弃的限定符没有警告

swift - 如何计算从选定时间(小时)到给定持续时间的时间(以小时为单位)

Swift 组合链接 .mapError()

php - 发送电子邮件时是否需要换行?

react-native - 如何在 React Native 中禁用警告?

php - "Notice: Undefined variable"、 "Notice: Undefined index"、 "Warning: Undefined array key"和 "Notice: Undefined offset"使用 PHP

ios - 即使我设置了 `numberOfLines = 0`,UILabel 也不换行