我正在开发一个应用程序,允许用户通过邮件拍照并发送(xcode版本5.1.1)。邮件发送后,确认弹出消息:iOS应用程序崩溃点击按钮
- (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error{
switch (result)
{
case MFMailComposeResultCancelled:
[[[UIAlertView alloc]initWithTitle:@"Message Cancelled" message:nil delegate:self cancelButtonTitle:@"OK" otherButtonTitles: nil]show];
break;
case MFMailComposeResultSent:
[[[UIAlertView alloc]initWithTitle:@"Message Sent" message:@"Thank you for your help." delegate:self cancelButtonTitle:@"OK" otherButtonTitles: nil]show]; break;
default:
break;
}
[self dismissViewControllerAnimated:NO completion:nil];
}
关于在模拟器“OK”点击,Xcode中突出了main.m文件代码,短语“主题1:信号SIGABRT” :
int main(int argc, char * argv[])
{
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}
当我在iPhone上测试的应用程序,同样的事情,它点击OK时崩溃。
你对如何解决这个问题有什么想法吗?
提前感谢您的帮助和建议
尝试添加异常断点并重现崩溃:http://stackoverflow.com/questions/17802662/exception-breakpoint-in-xcode – BergQuester
我无法重现您的问题。用我的测试中的委托方法显示alertView。你向viewController声明了'MFMailComposeViewControllerDelegate'?请显示您如何调用'MFMailComposeViewController'并设置邮件。 – Sebastian
要了解如何调试,请参阅http://www.raywenderlich.com/10209/my-app-crashed-now-what-part-1 – rmaddy