如何解决如果在第三方插件中调用,如何在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 举报,一经查实,本站将立刻删除。