小编Tru*_*ong的帖子

MFMailComposeViewController马上解散

情况是MFMailComposeViewController将被呈现.我看到它已经完成了一半,但后来被解雇了.

这是错误:

_serviceViewControllerReady:error:Error Domain = _UIViewServiceInterfaceErrorDomain Code = 3"无法完成操作.(_UIViewServiceInterfaceErrorDomain error 3.)"

这是我提供MFMailComposeViewController的源代码:

-(void) MailExecute {
    if ([MFMailComposeViewController canSendMail]) 
    {
        MFMailComposeViewController *mailViewController = [[MFMailComposeViewController alloc] init];   
        mailViewController.mailComposeDelegate = self;
        [mailViewController setSubject:NSLocalizedString(@"Check this new look", @"")];
        [mailViewController setMessageBody: @"my new look" isHTML:YES];

        [self presentModalViewController:mailViewController animated:YES];

        [mailViewController release];
    }
    else 
    {
        UIAlertView *alertInternal = [[UIAlertView alloc]
                                      initWithTitle: NSLocalizedString(@"Notification", @"")
                                      message: NSLocalizedString(@"You have not configured your e-mail client.", @"")
                                      delegate: nil
                                      cancelButtonTitle:NSLocalizedString(@"OK", @"")
                                      otherButtonTitles:nil];
        [alertInternal show];
        [alertInternal release];
    }
}
Run Code Online (Sandbox Code Playgroud)

奇怪的是,有时会发生,有时则不然.请帮帮我!我花了将近1个工作日来解决这个问题,但没有成功.

objective-c ios mfmailcomposer mfmailcomposeviewcontroller

24
推荐指数
1
解决办法
1万
查看次数