1

我有一个 MFMailComposeViewController,我相信它是正确实现的。但是,当它显示在屏幕上(通过模态)时,它只是打开,挂起一秒钟,然后关闭并记录MFMailComposeResultCancelled

有什么想法吗?

            if ([MFMailComposeViewController canSendMail]){
                MFMailComposeViewController *composer = [[MFMailComposeViewController alloc] init];



                if( composer == nil ){
                    UIAlertView* alert_view = [[UIAlertView alloc] initWithTitle:@"message"
                                                                          message:@"You will need to setup a mail account on your device before you can send mail!"
                                                                         delegate:nil
                                                                cancelButtonTitle:@"OK"
                                                                otherButtonTitles:nil];
                    [alert_view show];
                    return;
                }else{



                composer.mailComposeDelegate = self;
                [composer setSubject:@"I have an issue"];
                [composer setMessageBody:@"" isHTML:NO];
                [composer setToRecipients:@[@"email"]];
                }


                [self presentViewController:composer animated:YES completion:^{
                    ;
                }];

编辑在日志中找到了这些

Unbalanced calls to begin/end appearance transitions for <UINavigationController: 0xcda5e90>.

The operation couldn’t be completed. (Cocoa error 4097.)

4

2 回答 2

3

如果在拉起 MFMailComposer 时 UI 发生任何更改,则调用 MFMailComposeResultCancelled。

我必须是默认的 iOS 导航标题,但您可以更改色调。

于 2013-11-14T20:24:56.120 回答
0

在你完成后,如果你什么都不做,put nil,可能这就是问题所在。

于 2013-10-29T17:10:17.077 回答