MFmailcomposer有时会出错吗? [英] The MFmailcomposer is sometime giving error?

查看:88
本文介绍了MFmailcomposer有时会出错吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用MFMailcomposer从我的iPhone应用程序发送邮件。它工作正常,但是当我将它移植到iPhone 5和ios6时

I am using MFMailcomposer for sending mail from my application in IPhone.It is all working fine,but when i port it to iPhone 5 and ios6 sometime

_serviceViewControllerReady:错误:错误Domain = _UIViewServiceInterfaceErrorDomain Code = 1操作无法完成。(_UIViewServiceInterfaceErrorDomain错误1。但如果我再次运行则没有问题它运行正常。

_serviceViewControllerReady:error: Error Domain=_UIViewServiceInterfaceErrorDomain Code=1 "The operation couldn’t be completed. (_UIViewServiceInterfaceErrorDomain error 1. but if i run again there is no problem it was working fine.

我正在呈现这样的邮件作曲家`

I am presenting the mail composer like this `

action
{
Class mailClass = (NSClassFromString(@"MFMailComposeViewController"));
    if (mailClass != nil)
    {
        // We must always check whether the current device is configured for sending emails
        if ([mailClass canSendMail])
        {
            [self displayComposerSheet];
        }
        else
        {
            [self launchMailAppOnDevice];
        }
    }
    else
    {
        [self launchMailAppOnDevice];
    }

}


void)displayComposerSheet 
{

    AppDelegate *appdelegate=[[UIApplication sharedApplication] delegate];
    MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
    picker.mailComposeDelegate = self;  

    [picker setSubject:@"report"];



    // Set up recipients
    NSArray *toRecipients=[NSArray arrayWithObject:@""]; 
    NSArray *ccRecipients =[[NSArray alloc]init];//= [NSArray arrayWithObjects:@"", @"", nil]; 
    NSArray *bccRecipients=[[NSArray alloc]init];// = [NSArray arrayWithObject:@""];    
    [picker setToRecipients:toRecipients];
    [picker setCcRecipients:ccRecipients];  
    [picker setBccRecipients:bccRecipients];    
    [picker setMessageBody:@"Please send me  now." isHTML:YES];





    [appdelegate.navigationController presentModalViewController:picker animated:YES];
    [appdelegate.navigationController.navigationBar setHidden:NO];
    [picker release];
}

`

推荐答案

我遇到了同样的问题,它似乎是一个与特定 UIAppearance 自定义相关的错误。当我删除 UISearchBar 背景图片的自定义时,它完全消失。

I had the same issue, and it seems to be a bug that is related to specific UIAppearance customizations. It goes away entirely when I remove my customization of UISearchBar background images.

这篇关于MFmailcomposer有时会出错吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆