iOS 6 では、(MFMailComposeViewController を使用して) いくつかの電子メール メッセージを送信した後、電子メール画面を開くのが非常に遅くなります。最終的に (約 8 メッセージを送信した後)、電子メール ビュー コントローラーが適切に表示される前に、黒い画面が数秒間ユーザーに表示されます。
各黒い画面が表示される前に、ログは次の行を吐き出します。
[MFMailComposeRemoteViewController: ....] com.apple.MailCompositionService からのフェンス バリアの待機中にタイムアウトしました
また、iOS6 で MFMailComposeViewController を使用すると、MailCompositionS プロセスがメモリを占有し始めます (私の iPhone では約 260MB に達します)。これが MFMailComposeViewController の表示の問題の理由だと思います。
iOS 5 ではすべて問題なく動作します。この問題は iOS 6 でのみ発生します。
この問題を解決する方法を見つけた人はいますか?
ありがとう!
コードは標準ですが、とにかく含めます。
-(IBAction)doEmailLog:(id)sender 
{    
    if( [self canSendMail] )
    {       
        // create the compose message view controller
        MFMailComposeViewController* mailComposer = [[MFMailComposeViewController alloc] init];
        // this class will handle the cancel / send results
        mailComposer.mailComposeDelegate = self;
        // fill in the header and body
        [mailComposer setSubject:@"My Subject"];
        [mailComposer setMessageBody:@"My message body" isHTML:NO];
        // attach log file
        if ([[NSFileManager defaultManager] fileExistsAtPath:filename])
        { 
            NSData *data = [NSData dataWithContentsOfFile:filename];
            [mailComposer addAttachmentData:data mimeType:@"text/plain" fileName:filename];
        }
        // show the view controller
        [self presentViewController:mailComposer animated:YES completion:^{LogTrace(@"Presented mail view controller");}];
    }
    else
    {
        ...
    }
}
-(void)mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error
{
    ...
    // dismiss the compose message view controller
    [self dismissViewControllerAnimated:YES completion:^{LogTrace(@"Finished dismissing mail controller");}];
}