【发布时间】:2014-09-04 16:35:52
【问题描述】:
当我尝试使用 UIDocumentInteractionController 打开一个 pdf 文件时,所有已安装的可以处理 PDF 的应用程序都会出现。如果我选择邮件应用程序,它会按预期工作,并且文件会附加到新邮件,但其他所有应用程序都会失败。如果我尝试将文档从 DropBox 共享到 PDF 查看器,它可以工作。
我正在使用的代码:
- (void)presentOptionsForFilename:(NSString *)path {
NSURL *url = [NSURL fileURLWithPath:path];
if (url) {
self.documentInteractionController = [UIDocumentInteractionController interactionControllerWithURL: url];
if (self.documentInteractionController != nil) {
self.documentInteractionController.delegate = self;
[self.documentInteractionController presentOptionsMenuFromRect:CGRectZero
inView:self.view
animated:YES];
}
}
}
每次我选择一个不是邮件的应用程序时,我都会在设备控制台中获得这些条目。我不认为它们与问题有关,因为当我从 DropBox 工作的地方打开 pdf 时,它们也会到达那里。
Sep 3 12:37:13 <devicename>-iPad com.apple.mdt[262] <Notice>: Copy /var/mobile/Applications/80BC2CCF-E49A-4800-8005-30DD304701CF/tmp/DBExportDir/Getting Started.pdf -> /private/var/mobile/Applications/3374FC4A-D57F-476E-ABC9-94A2484343D6/Documents/Inbox
Sep 3 12:37:14 <devicename>-iPad wirelessproxd[36] <Notice>: (Note ) stopped advertising for sharingd
Sep 3 12:37:14 <devicename>-iPad wirelessproxd[36] <Notice>: (Error) error event: (<OS_xpc_error: <error: 0x192c3bdc8> { count = 1, contents =
"XPCErrorDescription" => <string: 0x192c3c0d0> { length = 18, contents = "Connection invalid" }
【问题讨论】:
标签: ios pdf uidocumentinteraction