簡體   English   中英

MFMailComposeViewController在iOS 7下無法正常工作

[英]MFMailComposeViewController is not working under iOS 7

[MFMailComposeViewController canSendMail]在iOS 6應用程序下運行良好,但在iOS7下無法運行。

iOS 6郵件功能:

if ([MFMailComposeViewController canSendMail])
{
    MFMailComposeViewController *mailer = [[MFMailComposeViewController alloc] init];
    mailer.mailComposeDelegate = self;
    [mailer setSubject:@"A Message from Bloomingkids"];
    NSArray *toRecipients = [NSArray arrayWithObjects:@"support@bloomingkids.com", nil];
    [mailer setToRecipients:toRecipients];
    UIImage *myImage = [UIImage imageNamed:@"bloomingKidsLogo.png"];
    NSData *imageData = UIImagePNGRepresentation(myImage);
    [mailer addAttachmentData:imageData mimeType:@"image/png" fileName:@"Images"];
    NSString *emailBody = @"Have you seen the Bloomingkids web site?";
    [mailer setMessageBody:emailBody isHTML:NO];
    [self presentViewController:mailer animated:YES completion:nil];
}
else
{
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Failure"
                                                    message:@"Your device doesn't support the composer sheet"
                                                   delegate:nil
                                          cancelButtonTitle:@"OK"
                                          otherButtonTitles: nil];
    [alert show];
}

注意:它可以在模擬器上運行,但不能在iPad上運行。 錯誤是您的設備不支持作曲家表格

在您的設備中添加任何電子郵件帳戶意味着要設置一個電子郵件帳戶...

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM