我最近遇到过问题。这曾经工作得很好,但最近,也许早在iOS 10.0,这只会导致应用程序崩溃,并出现以下错误:
由于未捕获的异常'NSInvalidArgumentException'而终止应用程序,原因:'不支持推送导航控制器'
需要改变什么?
-(void) emailIt {
MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
picker.mailComposeDelegate = self;
[picker setSubject:@"To Fritch Church of Christ"];
// Set up recipients
NSArray *toRecipients = [NSArray arrayWithObject:@"tbrass84@yahoo.com"];
[picker setToRecipients:toRecipients];
// Fill out the email body text
NSString *emailBody = @"Sent from the Fritch Church of Christ iOS App";
[picker setMessageBody:emailBody isHTML:NO];
[self.navigationController pushViewController:picker animated:YES];
[picker release];
}