【问题标题】:Trying to attach image to mail in my app尝试在我的应用程序中将图像附加到邮件
【发布时间】:2013-12-05 20:17:21
【问题描述】:

我正在使用 UIimagepicker 选择应附加到我的 ios 应用程序中的邮件的图像。我收到此错误:

警告:在演示过程中尝试在 <0xb642520><0xc142ab0>

    标签: ios uiimagepickercontroller mfmailcomposeviewcontroller


    【解决方案1】:

    问题是您在图像选择器被关闭时呈现邮件编写器。使用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];
    }];
    

    【讨论】:

      猜你喜欢
      • 2016-08-21
      • 2012-10-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多