iOS共享文件

时间:2012-07-30 19:00:04

标签: iphone ios file-permissions

  

可能重复:
  How can I transfer files from one application to another in the same iOS device?

我在应用程序中有一个文件从网络下载到应用程序的文档目录。我想在另一个应用程序中打开此文件(使用自定义URL方案)。

我遇到了权限问题,因为应用程序是沙箱,而其他应用程序无法在我的应用程序文档目录中看到该文件。

我可以在哪里放置文件以便其他应用程序可以读取它?

1 个答案:

答案 0 :(得分:3)

你解释不能这样做。

您需要做的是将应用程序设置为“接受”某些类型的文件。为此,您可以将您的应用程序“注册”为可能的PDF文件接收器。

查看此文档:https://developer.apple.com/library/ios/#documentation/FileManagement/Conceptual/DocumentInteraction_TopicsForIOS/Articles/RegisteringtheFileTypesYourAppSupports.html%23//apple_ref/doc/uid/TP40010411-SW1

您应该查看UIDocumentInteractionController类。