是否可以将 iOS 文件共享功能限制到文档目录中的子文件夹?
我的图像编辑应用程序正在文档目录中保存一些重要数据。在教程中,我正在读这个:
然后 iTunes 将显示您的任何内容 保存到Documents目录中 当用户访问时,您的应用程序将呈现给他们 iTunes 中的“应用程序”页面并滚动 到底部:
我有一个名为 userImages 的子文件夹,最好将文件共享仅限于该文件夹而不是文档中的所有内容。否则,用户会意外(或故意)弄乱应用程序正常工作所依赖的文件。这会很糟糕。
有没有办法将其限制为文档中的子目录?
My image editing app is saving some important data in the documents directory. In a tutorial I was reading this:
iTunes will then display anything you
save to the Documents directory in
your app to the user, when they go to
the “Apps” page in iTunes and scroll
to the bottom:
I have a subfolder called userImages and it would be clever to restrict file sharing only to that folder and not to everything in documents. Otherwise the user would accidently (or on purpose) mess around with files that the app depends on to work properly. This would be bad.
Is there a way to restrict it to a subdirectory in documents?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,您应该做的是将您不希望用户看到的任何内容存储在应用程序的“库”目录中。在此处查看可以存储数据的位置列表:
如何在iPhone上获得可写路径?
No, what you should do instead is store anything you do not want users seeing in the "Library" directory for the app. Check here for a list of places you can store data:
How can I get a writable path on the iPhone?