我们最近发现了我们的 UIActivityViewController 实现调用显示 MailComposerVC、消息、facebook 和 twiter VC 的模式视图的问题。在所有较旧的设备上,所需的消息编写器打开并允许用户在点击活动表上的图标后编写消息。在 64 位设备和 64 位模拟器上,当用户点击相关图标时,活动失败(优雅地),我们在控制台中看到以下错误:
2013-11-08 12:13:00.885 2life[24880:a0b] 找不到 CFBundle 0xd2795d0 的可执行文件(未加载) 2013-11-08 12:13:00.891 2life[24880:a0b] 启动服务:注册未知应用标识符 com.apple.mobilemail 失败 2013-11-08 12:13:00.892 2life[24880:a0b] 启动服务:找不到应用标识符 com.apple.mobilemail 2013-11-08 12:13:09.267 2life[24880:a0b] _serviceViewControllerReady:error: Error Domain=NSCocoaErrorDomain Code=4097 “操作无法完成。(Cocoa 错误 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];
}
}