【问题标题】:UIDocumentInteractionController Opening file in a specific app without optionsUIDocumentInteractionController 在没有选项的特定应用程序中打开文件
【发布时间】:2011-07-24 15:36:32
【问题描述】:

我正在使用 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 打开文件,不带选项框。有什么想法吗?

【问题讨论】:

    标签: ios iphone objective-c handler uidocumentinteraction


    【解决方案1】:

    我很高兴被反驳,但我认为这是不可能的(至少在 iOS 4 之前并包括在内)。

    在另一个应用程序中打开文件的常规方法是使用自定义 URL 方案。 (请参阅 openURL 的文档:在 UIApplication 类参考中以及在 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。但目前还不清楚你还能做很多其他事情。

    【讨论】:

    • 如果我们在谈论 instagram?它有 instagram:// 方案,但我不知道有任何正常的方法可以在那里传递图像。
    • iOS 5 可能为我们添加了什么?我找不到任何东西,但我想如果有人有我会问的!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-10-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-06-17
    • 1970-01-01
    相关资源
    最近更新 更多