这个问题在这里已经有了答案:
UIDocumentInteractionController no longer works in iOS6
(2 个回答)
9年前关闭。
在我的应用程序中,我使用 UIDocumentInteractionController 将 pdf 文档打开到 acrobat 阅读器(或任何其他查看器)中,但从 iOS6 开始它不再工作了。
我尝试了很多东西,最后一个来自here :
UIDocumentInteractionController *docController = [[UIDocumentInteractionController alloc]init];
docController = [UIDocumentInteractionController interactionControllerWithURL:[NSURL fileURLWithPath:documentsDirectory]];
docControler.UTI = @"com.adobe.pdf";
docController.delegate = self;
CGrect navRect = self.view.frame;
[docController presentOpenInMenuFromRect:navRect inView:self.view animated:YES];
当此代码运行时,我的应用程序完全卡住。
我尝试使用“presentOpenInMenuFromBarButtonItem”,但我遇到了同样的问题。
最佳答案
将 Controller 分配给强引用的属性:
@property (nonatomic, strong) UIDocumentInteractionController *docController;
关于iphone - UIDocumentInteractionController 自 iOS6 起不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15881176/