我正在使用UIDocumentInteractionController在另一个应用程序DropBox中打开一个文件。
我试图做的是在另一个特定的应用程序中打开文件,但到目前为止,我只能显示支持的应用程序,并允许用户选择。
UIDocumentInteractionController *udi = [UIDocumentInteractionController interactionControllerWithURL:[NSURL fileURLWithPath: jpgPath]];
[udi retain];
CGRect r = CGRectMake(0, 0, 300, 300);
[udi presentOpenInMenuFromRect:r inView:self.view animated:YES];这显示了一个支持的应用程序列表,但我想直接使用dropbox打开文件,而不是选项框。有什么想法吗?
发布于 2011-07-25 02:03:36
我很高兴被反驳,但我认为这是不可能的(至少在iOS 4之前是这样)。
在另一个应用程序中打开文件的正常方法是使用自定义URL方案。(请参阅《UIApplication类参考》中的openURL文档以及《iOS应用程序编程指南》中的Implementing Custom URL Schemes。)据我所知,Dropbox还没有实现自定义URL方案。考虑到这一点,这种方法是封闭的。
UIDocumentationController相当不透明。您可以将其转换为telling you whether or not there is any application on the device that will open your file。但目前还不清楚你还能做什么。
https://stackoverflow.com/questions/6807764
复制相似问题