在iOs上使用默认应用程序打开文件

时间:2012-04-05 09:57:03

标签: ios flash air

我正在尝试openWithDefaultApplication在iPad上下载的文件(存储到app文档目录中)。我安装了PDFReaderLite,但openWithDefaultApplication仍然无法重新识别扩展程序pdf。如何使PDFReaderLite成为打开pdf的默认应用程序?

提前谢谢

2 个答案:

答案 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];
        }