如果在第三方插件中调用,如何在UIDocumentInteractionController中使用presentOptionsMenuFromRect

问题描述

我在Appcelerator中开发了abn应用程序。
我想显示我可以用来打开已下载并存储在应用程序“缓存文件夹”中的文档的应用程序选项/列表。

但是只要我使用以下代码打开它:

    NSFileManager *fileManager = [NSFileManager defaultManager];
    
    NSArray *directoryPaths = NSSearchPathForDirectoriesInDomains
    (NSCachesDirectory,NSUserDomainMask,YES);
    Nsstring *documentsDirectoryPath = [directoryPaths objectAtIndex:0];
    Nsstring *filePath = [documentsDirectoryPath stringByAppendingPathComponent:fileName];
    
//    _docController = [[UIDocumentInteractionController alloc]init];
//
    if ([fileManager fileExistsAtPath:filePath]==YES) {
       NSLog(@"File exists");
        self._docController = [UIDocumentInteractionController interactionControllerWithURL:[NSURL fileURLWithPath:filePath]];
        self._docController.delegate=self;
        [self._docController presentOptionsMenuFromrect:self.view.frame inView:self.view animated:YES];
        return true;
    }else{
        NSLog(@"Failed to show Open In menu");
        return false;
    }

我遇到此错误

NSinvalidargumentexception *** -[__NSPlaceholderArray initWithObjects:count:] attempt to insert nil object from objects[0]

有人可以帮我吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)