我正在尝试openWithDefaultApplication
在iPad上下载的文件(存储到app文档目录中)。我安装了PDFReaderLite
,但openWithDefaultApplication
仍然无法重新识别扩展程序pdf
。如何使PDFReaderLite
成为打开pdf的默认应用程序?
提前谢谢
答案 0 :(得分:1)
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/filesystem/File.html#openWithDefaultApplication%28%29这表明openWithDefaultApplication是一个桌面功能。我认为默认应用程序功能甚至不存在于iOS ...
答案 1 :(得分:0)
UIButton *button = (UIButton *)sender;
NSURL *URL = [[NSBundle mainBundle] URLForResource:@"file_1" withExtension:@"pdf"];
if (URL) {
// Initialize Document Interaction Controller
self.documentInteractionController = [UIDocumentInteractionController interactionControllerWithURL:URL];
// Configure Document Interaction Controller
[self.documentInteractionController setDelegate:self];
// Present Open In Menu
BOOL flag =[self.documentInteractionController presentOpenInMenuFromRect:[button frame] inView:self.view animated:YES];
if (!flag) {
//[appDel showAlert:@"There is no supported app installed in your phone"];
[self.documentInteractionController presentPreviewAnimated:YES];
}