UIDocumentInteractionController presentOptionsMenuFromBarButtonItem 在 ios8 硬件(而不是 7.1 硬件或更早版本的硬件)中给我一个控制台错误:
Unknown activity items supplied: (
{
"com.adobe.pdf" = ;
},
""
)
In my official App Store version of my app, the app crashes at this point. When I compile and run on my iPad it just gives the error but does not crash.
My code:
In the .h:
UIDocumentInteractionController *docInteractionController;
在 .m 中:
self.docInteractionController = [UIDocumentInteractionController interactionControllerWithURL:fileURL];
self.docInteractionController.delegate = self;
//UIBarButtonItem *element is an element in my toolbar
[self.docInteractionController presentOptionsMenuFromBarButtonItem:element animated:YES];
如果我执行 docInteractionController.UTI 的 NSLog,我会在控制台看到“com.adobe.pdf”,因此可以正确识别 UTI。
我可以通过在 UIDocumentInteractionController 调用中使用 presentOpenInMenuFromBarButtonItem 而不是 presentOptionsMenuFromBarButtonItem 来绕过“未知事件项目”,但我还想向用户显示打印和电子邮件选项,而不仅仅是外部应用程序打开选项。
在 iPad 版本 8.0.2 上测试。 Xcode 版本 6.0.1,部署目标 6.0(也使用部署目标 8.0 进行了测试)。所有 objective-c 。在 iPad 版本 7.1 上运行不会产生错误。
最佳答案
查看雷达:http://openradar.appspot.com/radar?id=5800473659441152
关于ios - ios8 中的 UIDocumentInteractionController presentOptionsMenuFromBarButtonItem 错误-提供的事件项目未知,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26346510/