我的应用程序有一个文档交互控制器,用于打开其他应用程序中的文档。下面的代码显示一个按钮,该按钮打开“打开”菜单,并允许用户在其他应用程序中打开该文件--即,如果用户在“打开”菜单中选择邮件应用程序,邮件应用程序将创建一个新的电子邮件并自动将该文件附加到邮件主体。
以下代码在iOS7中运行良好,但在iOS8+上停止工作。文件没有附加到邮件中,我收到了错误日志消息。
UIDocumentInteractionController:的声明
@property (nonatomic, strong) UIDocumentInteractionController* interactionController;Initialization:
self.interactionController = [UIDocumentInteractionController interactionControllerWithURL:self.url];
self.interactionController.delegate = self;
self.interactionController.name = self.file.name;调用“打开”菜单:
[self.interactionController presentOpenInMenuFromBarButtonItem:self.openInBarButtonItem animated:YES];打开excel文件后收到的错误消息的示例:
提供的未知活动项目:({ "com.microsoft.excel.xls“= <504b0304 ....000000>;},"”) viewServiceDidTerminateWithError: Error Domain=_UIViewServiceInterfaceErrorDomain Code=3“操作无法完成。(_UIViewServiceInterfaceErrorDomain错误3.)UserInfo=0x…{Message=Service连接中断} (lldb)。
我希望有任何解决这个问题的想法。
谢谢你,奥利
发布于 2015-04-21 10:28:17
这是我的密码
BOOL IOS8=SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0");
if (IOS8){
if ([interactionController presentOpenInMenuFromRect:CGRectZero inView:self.view animated:YES]) {
NSLog(@"menu is presented");
}https://stackoverflow.com/questions/26862347
复制相似问题