我正在应用程序委托中实现电子邮件编写器。我不知道为什么,但我收到了警告
“实例方法 presentModalViewController:找不到动画”
仅在 appdelegate 中,而我在其他视图控制器中使用相同的方法,它运行顺利。
MFMailComposeViewController *mail = [[MFMailComposeViewController alloc] init];
mail.mailComposeDelegate = self;
if([MFMailComposeViewController canSendMail])
{
//Setting up the Subject, recipients, and message body.
[mail setToRecipients:[NSArray arrayWithObjects:@"abc@gmail.com",nil]];
UIImage *pic = [UIImage imageNamed:@"page0.png"];
NSData *exportData = UIImageJPEGRepresentation(pic ,1.0);
[mail addAttachmentData:exportData mimeType:@"image/jpeg" fileName:@"Picture.jpeg"];
[mail setSubject:@"dummy text"];
[mail setMessageBody:@"Please tell us what your concerns are and we will try to fix them" isHTML:NO];
//Present the mail view controller
[self presentModalViewController:mail animated:YES];
//release the mail [mail release];
}
[self presentModalViewController:mailer animated:YES];
当到达这里时,这是发出警告并且应用程序崩溃了。
有什么建议么。