UIDocumentInteractionController在没有选项的特定应用程序中打开文件 [英] UIDocumentInteractionController Opening file in a specific app without options

查看:284
本文介绍了UIDocumentInteractionController在没有选项的特定应用程序中打开文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用UIDocumentInteractionController在另一个应用程序DropBox中打开文件.

I'm using UIDocumentInteractionController to open a file in another app, DropBox.

我想做的是在另一个特定的应用程序中打开文件,但到目前为止,我只设法显示了受支持的应用程序并允许用户选择.

What i'm trying to do is open the file in another specific app , but i only managed so far to display the supported apps and allowing the user to choose.

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(不带选项框)打开文件.有什么想法吗?

This presents a list of apps supported, but i want to directly open the file with dropbox, without the options box. Any ideas?

推荐答案

我很高兴能自相矛盾,但是我认为这是不可能的(至少在iOS 4及以下).

I'd be delighted to be contradicted, but I think this is not possible (at least up to and including iOS 4).

在另一个应用程序中打开文件的通常方法是使用自定义URL方案. (请参阅《 UIApplication类参考》中有关openURL的文档:以及

The normal way to open a file in another application is to use a Custom URL scheme. (See the documentation for openURL: in the UIApplication Class Reference and also Implementing Custom URL Schemes in the iOS Application Programming Guide.) To the best of my knowledge, Dropbox have not implemented a Custom URL Scheme. And, given that, this approach is closed.

UIDocumentationController非常不透明.您可以将其哄骗到告诉您设备上是否有任何可打开文件的应用程序.但是尚不清楚您还能做些其他事情.

UIDocumentationController is pretty opaque. You can coax it into telling you whether or not there is any application on the device that will open your file. But it's not clear you can do much else.

这篇关于UIDocumentInteractionController在没有选项的特定应用程序中打开文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆