Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/amazon-s3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 通过UIDocumentInteractionController允许PDF预览选项_Ios_Pdf_Uidocumentinteraction - Fatal编程技术网

Ios 通过UIDocumentInteractionController允许PDF预览选项

Ios 通过UIDocumentInteractionController允许PDF预览选项,ios,pdf,uidocumentinteraction,Ios,Pdf,Uidocumentinteraction,大家好 我正在创建UIDocumentInteractionController以显示本地保存在我的应用程序文档文件夹中的.pdf文件。代码如下: if (theURLOfTheFile != nil && [theURLOfTheFile path] != nil && [[NSFileManager defaultManager] fileExistsAtPath:filePath]) { UIDocumentInter

大家好

我正在创建UIDocumentInteractionController以显示本地保存在我的应用程序文档文件夹中的.pdf文件。代码如下:

   if (theURLOfTheFile != nil && [theURLOfTheFile path] != nil && [[NSFileManager     defaultManager] fileExistsAtPath:filePath])
    {

        UIDocumentInteractionController *myInteractionController = [self setupControllerWithURL:theURLOfTheFile usingDelegate:self];

        self.customInteractionController = myInteractionController;
        self.customInteractionController.UTI = @"com.adobe.pdf";
        self.customInteractionController.delegate = self;
#define abf self.actionButton.frame

        //SPOT THE DIFFERENCE:


        if (!_interactionControllerVisible) {
            BOOL isValid = [self.customInteractionController presentOpenInMenuFromRect:CGRectMake(self.view.frame.size.height-100, 100, 500, 500) inView:self.view animated:YES];
        }




    } else {
        NSLog(@"Failed to open file. EscapedURL: %@",filePath);
    }

我没有得到预览选项,但我可以在iBooks中打开它,它工作得很好。我想启用打印和复制功能:(

使用
presentoptionmenufromrect:inView:animated:
而不是
presentoppeninmenufromrect:inView:animated:


“OpenIn”方法仅显示其他应用程序。“Options”方法提供所有其他选项。

如果我只想显示Whatsapp应用程序,我该怎么办?