MFMailComposeViewController:取消不会退出到我的应用程序?(MFMailComposeViewController : cancel doesn't exit to my app?)
我试图用MFMailComposeViewController发送邮件。 当我点击我的应用程序上的一个按钮时发生。 当然,当我单击邮件控制器的取消按钮时,我想回到我的应用程序视图,但它不起作用。 该怎么办 ? 这是我的代码:
MFMailComposeViewController *controller = [[MFMailComposeViewController alloc] init]; controller.mailComposeDelegate = self; [controller setSubject:@"Subject"]; [controller setMessageBody:@"<html>Test</html>" isHTML:YES]; [controller setToRecipients:nil]; if(controller) [self presentModalViewController:controller animated:YES];感谢您的建议
I'm trying to send a mail with MFMailComposeViewController. It happens when I click a button on my app. Of course when I click the Cancel button of the mail controller I want to go back to my app view but it doesn't work. What to do ? Here is my code :
MFMailComposeViewController *controller = [[MFMailComposeViewController alloc] init]; controller.mailComposeDelegate = self; [controller setSubject:@"Subject"]; [controller setMessageBody:@"<html>Test</html>" isHTML:YES]; [controller setToRecipients:nil]; if(controller) [self presentModalViewController:controller animated:YES];Thanks for your advices
最满意答案
你是否实现了这个委托方法? 这是在用户退出作曲家之后调用的。
- (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error { [self dismissViewControllerAnimated:YES completion:nil]; return; }Have you implemented this delegate method? It's called after the composer is exited by the user.
- (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error { [self dismissViewControllerAnimated:YES completion:nil]; return; }更多推荐
发布评论