Ios8 iOS 8中的UIDocumentInteractionController已损坏
下面的相关代码在我为iOS 7构建时工作得很好,但现在在iOS 8中似乎工作不正常 正确地说,我的意思是,它实际上并没有将文件或任何东西发送到所选的应用程序 示例:如果我选择Mail,它将打开带有我在文本字段中选择的图像或zip的Mail应用程序。现在它不会发送,调用/关闭UIDocumentInteractionController需要花费很长时间 我做错了什么Ios8 iOS 8中的UIDocumentInteractionController已损坏,ios8,tableview,share,cell,Ios8,Tableview,Share,Cell,下面的相关代码在我为iOS 7构建时工作得很好,但现在在iOS 8中似乎工作不正常 正确地说,我的意思是,它实际上并没有将文件或任何东西发送到所选的应用程序 示例:如果我选择Mail,它将打开带有我在文本字段中选择的图像或zip的Mail应用程序。现在它不会发送,调用/关闭UIDocumentInteractionController需要花费很长时间 我做错了什么 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[self.tableView deselectRowAtIndexPath:indexPath animated:NO];
NSString *fileName = [directoryContents objectAtIndex:indexPath.row];
NSString *path;
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
path = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"Downloads"];
path = [path stringByAppendingPathComponent:fileName];
documentController = [[UIDocumentInteractionController alloc] init];
documentController = [UIDocumentInteractionController interactionControllerWithURL:[NSURL fileURLWithPath:path]];
[documentController setDelegate:self];
[documentController presentOptionsMenuFromRect:CGRectZero inView:self.view animated:YES];
[documentController retain];
}
我一直在玩
UIDocumentInteractionController
,代理试图解决类似的问题,控制器正常打开,但选择一个应用程序导致它关闭而不做任何操作,我的代理方法DocumentInteractionControllerDismissOpenInMenu
也正常运行
在控制台中,我收到了iOS 8.0及更高版本不支持的通知enabledRemoteNotificationTypes。
当调用以下委托方法之一时,就会出现此问题:
documentInteractionControllerDidDismissOpenInMenu
documentInteractionControllerDidDismissOptionsMenu
(可能还有其他人,我没有全部检查)
我在IOS开发库或UIDocumentInteractionController.h中没有找到关于IOS 8.1不支持的这些方法的任何评论,但目前我找不到任何其他解释
解决方案:
我替换了菜单中的文档交互控制器IDDISMISSOPENINMENU
使用didEndSendingToApplication
它为我解决了问题。当我为iOS 7编写代码时,我没有在菜单DocumentInteractionControllerdDismissOpenInMenu DocumentInteractionControllerdDismissOptions菜单中使用DocumentInteractionControllerdDismissOptions菜单,就目前而言,我仍然没有使用它。尝试完全删除代理,它正在发送吗?您还实现了哪些其他委托方法?此外,当控制台输出无法发送时,控制台输出中写入了什么?OP中发布的内容就是与之相关的所有内容。至于在很长一段时间内出现故障时的输出是一大堆634e653a等,然后是:“)viewServiceDidTerminateWithError:Error Domain=\u UIViewServiceInterfaceErrorDomain Code=3”操作无法完成。(_UIViewServiceInterfaceErrorDomain错误3。)“UserInfo=0x7ff3f4b5d440{消息=服务连接中断}等待com.apple.mailcompositionservices的围栏屏障超时。你在模拟器上运行吗?模拟器8.1因MFMailCompositeMoteViewController而崩溃。尝试在实际设备上运行这是我从阅读主题中收集到的。但是,我没有iOS设备可供测试。我将尝试联系几个我认识的人。