I am developing an app that allows users to take pictures and send them by mail (xcode version 5.1.1). After the mail is sent, a confirmation message pops up:
- (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];
}
On click of "OK" in the simulator, Xcode highlights a code in the main.m file, with the phrase "Thread 1: signal SIGABRT":
int main(int argc, char * argv[])
{
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}
When I test the app on the iPhone, same thing, it crashes on click of OK.
Do you have any idea on how to solve this issue?
Many thanks in advance for your help and advice