Я получаю SIGABRT
ошибку, когда я отменяю MFMailComposeViewController
, точно в dismissViewController
, не работает
У меня есть UIViewController
в пределах UINavigationController
.
Мой код:
- (void)sendMail {
if ([MFMailComposeViewController canSendMail]) {
controller = [[MFMailComposeViewController alloc] init];
[[controller navigationBar] setTintColor:[UIColor getHexColorWithRGB:@"e2de09" alpha:1.0f]];
controller.mailComposeDelegate = self;
[controller setSubject:@"Subject"];
NSString *msg="xxxxx";
[controller setMessageBody:msg isHTML:YES];
[self presentModalViewController:controller animated:YES];
} else {
NSString * errorString = [NSString stringWithFormat:@"mail account not set."];
UIAlertView * errorAlert = [[UIAlertView alloc] initWithTitle:@"Error:" message:errorString delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[errorAlert show];
}
}
presentModalViewController:animated:
работает правильно.
- (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error {
[self becomeFirstResponder];
[self dismissModalViewControllerAnimated:YES];
}
Но вызов [self dissmissModalViewControllerAnimatedLYES]
вызывает ошибку SIGABRT
.