我编写了一个代码,它使用mfmailcomposibleviewcontroller来处理应用程序中的电子邮件。我在下面指定了委托,但没有调用委托方法。这是我第一次遇到这种错误;我通常在iPhone下开发,但对于一个客户,我需要在iPad下开发。
MFMailComposeViewController *mailComposer = [[MFMailComposeViewController alloc] init];
[mailComposer setModalPresentationStyle: UIModalPresentationFormSheet];
[mailComposer setSubject: @"Hello World"];
[mailComposer setMailComposeDelegate: self];
[mailComposer setMessageBody: @"<font color='red'>Hello</font> <font color='blue'>World</font>" isHTML:YES];
[self presentModalViewController: mailComposer animated: YES];
此代码段是调用mailview的方法的精确复制粘贴。请注意,我在头中指定了mfmailviewcontrollerdelegate协议。
谢谢您!