我将我的应用程序提交到应用程序商店,但他们拒绝了它,说当他们单击反馈按钮时应用程序崩溃了,该按钮是一个打开 MFMailComposeViewController 的按钮。我遇到的问题是我已经在模拟器和实际设备之间的许多设备上运行它,但我从来没有遇到过这个问题。我将在下面发布我调用的反馈按钮的功能,并且都连接到该按钮(就像我说每次我测试它时它都工作得很好),我的问题是:我在代码中做错了什么到哪里只有他们得到崩溃?
func giveFeedback()
{
let email = ["info@website.com"]
var fvc = view?.window?.rootViewController
var cev = MFMailComposeViewController()
cev.mailComposeDelegate = self
cev.setToRecipients(email)
cev.setSubject("MyApp")
fvc?.presentViewController(cev, animated: true, completion: nil)
}
func mailComposeController(controller: MFMailComposeViewController!, didFinishWithResult result: MFMailComposeResult, error: NSError!)
{
controller.dismissViewControllerAnimated(true, completion: nil)
}
另外,我已经导入MessageUI
了,在课堂上我有我的MFMailComposeViewControllerDelegate