UIActivityViewController reports “Remote compose controller timed out”

怎甘沉沦 提交于 2019-12-12 15:08:18

问题


I get this in the Xcode console when tapping on my App's share via Message: The Mail one works perfectly fine however. The Message controller never displays obviously, which makes this annoying in a shipped app.

Remote compose controller timed out (YES)!

Is this an Apple bug? It only started to happen today.

Code:

if(SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"6.0"))
{
    NSString *textToShare = [NSString stringWithFormat:@"test"];
    NSArray *activityItems = [[NSArray alloc]  initWithObjects:textToShare, nil];
    UIActivityViewController *activityVC = [[UIActivityViewController alloc] initWithActivityItems:activityItems
                                                  applicationActivities:nil];

    activityVC.completionHandler = ^(NSString *activityType, BOOL completed)
    {
        NSLog(@" activityType: %@", activityType);
        NSLog(@" completed: %i", completed);
    };

    if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
    {
        self.popover = [[UIPopoverController alloc] initWithContentViewController:activityVC];

        CGRect rect = [[UIScreen mainScreen] bounds];

        [self.popover
                    presentPopoverFromRect:rect inView:self.view permittedArrowDirections:0 animated:YES];
    }
    else
    {
        [self presentViewController:activityVC animated:YES completion:nil];
    }
}

回答1:


There's nothing wrong with this code. It works without problem on my devices. You might want to try rebooting your device or trying on another device.

The few isolated references that I found to this problem were related to beta versions of iOS 6 or other people suffering from the occasional crash, so perhaps we're just slowing working through the kinks in this messaging UI.



来源:https://stackoverflow.com/questions/13676500/uiactivityviewcontroller-reports-remote-compose-controller-timed-out

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