如何使用 UIFileSharingEnabled 共享/Documents 中的某个目录树列表

发布于 2024-11-15 15:48:32 字数 372 浏览 6 评论 0原文

我想将 itunes 文件共享集成到我的应用程序中。我知道我只需要在 info.plist 中设置 true UIFileSharingEnabled 。但它使我的应用程序中的 /Documents 中的所有文件和目录都显示在 itunes 文件共享中。我只想在 itunes 文件共享中共享一个目录树列表。

这是我的 /Documents 的屏幕截图(我从 iphone 模拟器目录中获取它,但它对于设备来说是相同的) 在此处输入图像描述

从这些图片中,我只想共享项目目录中的所有文件,而不显示项目目录本身。

我可以这样做吗?请帮我解决这个问题。

谢谢你,里斯玛

i want to integrate itunes file sharing into my app. I know that i just need to set true UIFileSharingEnabled in info.plist. But it make all files and directories in /Documents from my app is show in itunes file sharing. I just want to share a directory tree listing in itunes file sharing.

This is a screenshoot of my /Documents (i got it from iphone simulator directory but it is same for the device)
enter image description here

from that pictures, i just want to share the all files in Project directory without showing Project directory itself.

Can i do that? Please help me to solve this.

Thank you, Risma

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

血之狂魔 2024-11-22 15:48:32

我认为当您使用 Info.plist 中的 UIFileSharingEnabled 键启用文件共享时,您无法更改共享内容。

不过,我建议您修改内容,以便应用程序特定内容进入 Library 文件夹,例如数据库文件和其他非用户内容。您可能需要浏览 this 用于识别 iTunes 备份的文件夹。

I don't think you can alter what is shared when you enable file sharing by using the UIFileSharingEnabled key in Info.plist.

However I suggest that you revamp your content so that application specific content go into the Library folder such as the database file and other non-user stuff. You might want to go through this for identifying which folders are backed up by iTunes.

叶落知秋 2024-11-22 15:48:32

符号链接怎么样?如果您可以实现它们并控制权限,那么这将立即解决该问题。不知道如何在 iOS 上做到这一点,但这绝对值得研究。当谈到文件共享时,链接是您最好的朋友。

我没有任何 iPhone 应用程序开发经验,但我在 Linux 中完成了大量文件共享管理。希望不会有太大不同...但我不知道 iPhone 可以使用哪些系统调用。如果你知道的话,我很乐意知道。祝你好运!

How about a symbolic link? That would solve that issue in a snap, provided you can implement them and control permissions. Not sure how to do that with iOS, but it's definitely worth looking into. When it comes to file sharing, links are your best friend.

I don't have any experience with iPhone app dev, but I've done plenty of file share management in Linux. Hopefully it's not too different... But I have no idea what system calls are available to you with iPhones. If you find out, I'd enjoy knowing. Good luck!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文