我们最近发现了UIActivityViewController的实现问题,它调用了提供MailComposerVC,消息,facebook和twiter VC的模态视图。在所有较旧的devcies上,所需的消息编辑器打开,并允许用户在活动表上打开图标后撰写他们的消息。在64位设备和64位模拟器上,当用户点击相对图标时,活动失败(正常),我们在控制台中看到了followig错误:
2013-11-08 12:13:00.885 2life[24880:a0b] Cannot find executable for CFBundle 0xd2795d0 (not loaded) 2013-11-08 12:13:00.891 2life[24880:a0b] Launch Services: Registering unknown app identifier com.apple.mobilemail failed 2013-11-08 12:13:00.892 2life[24880:a0b] Launch Services: Unable to find app identifier com.apple.mobilemail 2013-11-08 12:13:09.267 2life[24880:a0b] _serviceViewControllerReady:error: Error Domain=NSCocoaErrorDomain Code=4097 "The operation couldn’t be completed. (Cocoa error 4097.)"
有没有人对此有任何见解? 这是我们的方法:
- (void)showShareView:(NSIndexPath *)indexPath
{
NSString *text = NSLocalizedString(@"tellAFriendText", @"This is deault text sting for the message.");
//NSString *text = @"Test";
UIImage *image = [UIImage imageNamed:@"tell-a-friend.png"];
NSArray *activityItems = [NSArray arrayWithObjects: text, image, nil];
UIActivityViewController * activityController = [[UIActivityViewController alloc] initWithActivityItems:activityItems applicationActivities:nil];
// activityController.tintColor = [UIColor colorWithWhite:1.0f alpha:0.8f];
NSArray *exclusions = @[UIActivityTypeSaveToCameraRoll,UIActivityTypeAssignToContact,UIActivityTypeCopyToPasteboard,UIActivityTypePrint];
activityController.excludedActivityTypes = exclusions;
if (iPhone) {
[self presentViewController:activityController animated:YES completion:nil];
}else if(iPad){
UIPopoverController *pop = [[UIPopoverController alloc] initWithContentViewController:activityController];
popover = pop;
CGRect rect = [self.menuTableView rectForRowAtIndexPath:indexPath];
rect.origin.x = (rect.size.width - rect.size.width/2)/2;
rect.size.width /= 2;
rect.size.height /= 2;
[pop presentPopoverFromRect:rect inView:self.menuTableView permittedArrowDirections:UIPopoverArrowDirectionDown animated:YES];
}
}
答案 0 :(得分:1)
我们最近解决了这个问题。事实证明,使用UIAppearnce调整BarButtonTitlePosition的位置会导致作曲家ViewControllers退出。 评论以下内容可以解决问题。
[[UIBarButtonItem外观] setBackButtonTitlePositionAdjustment:UIOffsetMake(0.0f,-2.0f)forBarMetrics:UIBarMetricsDefault];