如何为我的应用程序启用文件共享?
我有一个图像编辑应用程序,用户可以在其中对照片应用效果。我如何启用它,以便用户可以在 iTunes 的“文件共享”选项卡中看到我的应用程序,然后只需将照片拖放到应用程序中?
一些像 Stanza 这样的电子书阅读器就是这样工作的,这将是一个很酷的选择。也许有人可以指出有关如何启用和使用此技术的教程或资源。
I have an image editing app where users can apply effects to photos. How could I enable it so that users can see my app in iTunes in the File Sharing tab and then just drag+drop photos to the app?
Some of the eBook readers like Stanza works like this and it would be a cool option. Maybe someone can point out a tutorial or resource that talks about how to enable and use this technique.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(8)
在 Xcode 8.3.3 中,在 .plist 中添加具有 true 值的新行
In Xcode 8.3.3 add new row in .plist with true value
如果您直接编辑
info.plist
,下面的内容应该可以帮助您,不要在下面键入“YES”作为字符串:您应该使用这个:
If you editing
info.plist
directly, below should help you, don't key in "YES" as string below:You should use this:
除了启用 iTunes 文件共享之外,我还必须将
“支持就地打开文档”设置为“是”
,以便我的应用程序的文档目录在“文件”中可见。如果没有这个,阅读和写作就可以完美地工作,但如果不进行更改,我就无法在应用程序之外获取应用程序的文件。
In addition to enabling iTunes file sharing, I had to set
"Supports opening documents in place" to "YES"
in order for my app's Document directory to become visible in Files. Reading and writing worked perfectly without that, but I couldn't get at my app's files outside of the app without making that change.
您只需设置
UIFileSharingEnabled
(应用程序支持 iTunes 文件共享
)在应用程序的信息列表中键入。 这里是文档的链接。向下滚动到文件共享支持部分。过去,还需要定义
CFBundleDisplayName
(Bundle Display Name
)(如果尚不存在)。 更多详细信息请参见此处。You just have to set
UIFileSharingEnabled
(Application Supports iTunes file sharing
) key in the info plist of your app. Here's a link for the documentation. Scroll down to the file sharing support part.In the past, it was also necessary to define
CFBundleDisplayName
(Bundle Display Name
), if it wasn't already there. More details here.根据 苹果文档:
According to apple doc:
新的 XCode 7 仅需要 Info.plist 中的“UIFileSharingEnabled”键。
不再需要“CFBundleDisplayName”。
还有一点提示:不要只修改“tests”目标的 Info.plist。主应用程序和“测试”具有不同的 Info.plist。
New XCode 7 will only require 'UIFileSharingEnabled' key in Info.plist.
'CFBundleDisplayName' is not required any more.
One more hint: do not only modify the Info.plist of the 'tests' target. The main app and the 'tests' have different Info.plist.
如果你在plist中按字母顺序查找,应该是“应用程序支持iTunes文件共享”。
If you find by alphabet in plist, it should be "Application supports iTunes file sharing".
也许这对你们来说是显而易见的,但我挠了挠头一段时间,因为该文件夹没有显示在文件应用程序中。
我实际上需要在文件夹中存储一些东西。
来实现此目的,
Maybe it's obvious for you guys but I scratched my head for a while because the folder didn't show up in the files app.
I actually needed to store something in the folder.
you could achieve this by