【发布时间】:2016-03-08 02:06:02
【问题描述】:
每当我按“取消”然后“删除草稿”时,邮件编写器都不会被解雇。我得到的错误是“线程 1:EXC_BAD_ACCESS(代码=1,地址=0x40363380)”
在我的 TableViewController 我有:
@IBAction func mailButton(sender: AnyObject) {
let emailComposer = EmailComposer()
if email != "" {
print(email)
if emailComposer.canSendMail() {
emailComposer.setRecipient(email)
let configuredMailComposeViewController = emailComposer.configuredMailComposeViewController()
presentViewController(configuredMailComposeViewController, animated: true, completion: nil)
}
} else {
let alertController = UIAlertController(title: "Sorry!", message: "No email found for this contact", preferredStyle: .Alert)
alertController.addAction(UIAlertAction(title: "OK", style: .Default, handler: { (action) -> Void in
//do nothing
}))
self.presentViewController(alertController, animated: true, completion:nil)
}
}
【问题讨论】:
标签: swift mfmailcomposeviewcontroller