我对 iPhone 开发非常陌生。
在我的应用程序中,我想在单击按钮时使用 MFMailComposeViewController 发送电子邮件。
我怎样才能做到这一点?
我使用了下面的代码。
MFMailComposeViewController *controller = [[MFMailComposeViewController alloc] init];
[controller setSubject:@"Email App"];
[controller setMessageBody:@"Sample email app" isHTML:NO];
[self presentModalViewController:controller animated:YES]; // App crash in this line.
[controller release];
它显示了这个警告:
'ImportingDocumentAppDelegate' may not respond to '-presentModalViewController:animated:'.
谢谢.....
最佳答案
@阿伦presentModalViewController
是UIViewController
的方法所以你不能在应用委托(delegate)实例上调用它。将 UIViewController 的 View 添加到您的窗口,然后在该 View Controller 上调用此方法。
关于ios - 如何使用 MFMailComposeViewController 发送电子邮件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8264753/