【发布时间】:2013-12-05 20:17:21
【问题描述】:
我正在使用 UIimagepicker 选择应附加到我的 ios 应用程序中的邮件的图像。我收到此错误:
警告:在演示过程中尝试在 <0xb642520><0xc142ab0>0xc142ab0>0xb642520>
标签: ios uiimagepickercontroller mfmailcomposeviewcontroller
我正在使用 UIimagepicker 选择应附加到我的 ios 应用程序中的邮件的图像。我收到此错误:
警告:在演示过程中尝试在 <0xb642520><0xc142ab0>0xc142ab0>0xb642520>
标签: ios uiimagepickercontroller mfmailcomposeviewcontroller
问题是您在图像选择器被关闭时呈现邮件编写器。使用completion 参数:
[self dismissViewControllerAnimated:YES completion:^{
MFMailComposeViewController * mailComposer = [[MFMailComposeViewController alloc]init];
mailComposer.mailComposeDelegate = self;
// make sure you can make NSData from the object
[mailComposer addAttachmentData:UIImageJPEGRepresentation(imageToUse, 1.0) mimeType:@"image/jpg" fileName:@"what ever you want to call the file"];
[self presentViewController:mailComposer animated:YES completion:nil];
}];
【讨论】: