gpt4 book ai didi

ios - 不允许在释放时尝试加载 View Controller 的 View ,这可能会导致未定义的行为

转载 作者:可可西里 更新时间:2023-11-01 01:03:32 26 4
gpt4 key购买 nike

我正在尝试实现发送邮件代码,但出现以下错误:

Attempting to load the view of a view controller while it is deallocating is not allowed and may result in undefined behavior

这是我的代码片段:

    if MFMailComposeViewController.canSendMail() {
let mail = MFMailComposeViewController()
mail.mailComposeDelegate = self
mail.setToRecipients(["@gmail.com"])
presentViewController(mail, animated: true, completion: nil)
} else {
// show failure alert
}

最佳答案

如果您忘记删除按钮的另一个功能的转场,则可能会发生您收到的错误。

关于ios - 不允许在释放时尝试加载 View Controller 的 View ,这可能会导致未定义的行为,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33176169/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com