MFMessageComposeViewController much slower on iOS 7

纵然是瞬间 提交于 2020-01-01 04:38:05

问题


I've an app for sending email and text messages.

The problem that i'm having is that the loading of the MFMessageComposeViewController much slower on iOS 7 than it was on prior iOS and it becomes worst as the number of contacts increases.

Screen goes black for seconds before Messages app opens with the contents loaded.

Any thoughts?

With the same large number of emails, the MFMailComposeViewController is as quicker as before.

Help!! Thanks.


回答1:


This issue has been fixed with iOS7.0.3




回答2:


I have the same problem. I made the composer strong reference with

@property (nonatomic, strong, retain) MFMessageComposeViewController *messageComposer;

Then owner class calls this method:

-(void)sendSMSFromController:(UIViewController*)controller
{
    self.messageComposer = [MFMessageComposeViewController new];

    if([MFMessageComposeViewController canSendText]) {
        [_messageComposer setBody:_body];
        [_messageComposer setRecipients:[NSArray arrayWithObjects:_recipient, nil]];
        [_messageComposer setMessageComposeDelegate:self];
        [controller presentViewController:_messageComposer animated:NO completion:NULL];
    }
}

Composer appears quickly but disappears slowly. Finalizes with:

- (void)messageComposeViewController:(MFMessageComposeViewController *)controller didFinishWithResult:(MessageComposeResult)result
{
    switch (result) {
        case MessageComposeResultCancelled:
            NSLog(@"Message sending cancelled.");
            break;

        case MessageComposeResultFailed:
            NSLog(@"Message sending failed.");
            break;

        case MessageComposeResultSent:
            NSLog(@"Message sent.");
        default:
            break;
    }


    [controller dismissViewControllerAnimated:YES completion:^(){
        self.messageComposer = nil;
    }];
}

After restarting my device it clearly works. Before restart (after messing with MessageService by sending invalid recipients) it failed.




回答3:


I am encountering this issue as well, for iMessage recipients.

Seems to be tied to iMessage syncing history down from iCloud. I had 4 recipients and it took about ~30 seconds for the first Apple iMessage dialog to pop up.

After waiting on this once, I canceled out of the sends, the next repeated attempt resolved quickly -- this result, plus the fact that iOS7 displays message history in the composer view (pre iOS7 does not), has led me to conclude that Apple is waiting on some kind of iCloud sync before popping up the view.

This reproduced on both an iPhone 4 and a new iPhone 5s with different iCloud accounts, so it does not seem to be hardware limited or unique to my iCloud account or recipients.


I have no confirmed solution for this issue, but I have some workarounds to suggest for further investigation:

  • Some of our users have reported that rebooting the device resolves this issue.
  • This may be a "1 time fee" per unique iMessage recipient after upgrading to iOS7.


来源:https://stackoverflow.com/questions/19027180/mfmessagecomposeviewcontroller-much-slower-on-ios-7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!