相关疑难解决方法(0)

iOS6:MFMailComposeViewController缓慢加载并闪烁黑屏; MailCompositionS开始占用内存

在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];
        } …
Run Code Online (Sandbox Code Playgroud)

objective-c mfmailcomposer ios6 mfmailcomposeviewcontroller

16
推荐指数
1
解决办法
6608
查看次数