1

MFMailComposeViewController があり、正しく実装されていると思います。ただし、(モーダルを介して)画面に表示されると、開き、1秒間ハングしてから閉じてログに記録します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:^{
                    ;
                }];

EDITはログでこれらを見つけました

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

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

4

2 に答える 2

3

MFMailComposeResultCancelled は、MFMailComposer がプルアップされたときに UI に変更が発生した場合に呼び出されます。

色合いは変更できますが、I がデフォルトの iOS ナビゲーション ヘッダーである必要があります。

于 2013-11-14T20:24:56.120 に答える
0

完了時に何もしない場合はnil、おそらくこれが問題です。

于 2013-10-29T17:10:17.077 に答える