可以将下载的图像/文件添加到我的应用包中吗? [英] Can downloaded images/files be added to my app bundle?

查看:86
本文介绍了可以将下载的图像/文件添加到我的应用包中吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序,允许我下载字符(图像),声音等。当用户选择下载哪个字符时,我可以将其存储在我的应用程序包中的目录中?如果没有,哪里是存储我的内容(数据)的最佳位置?我在考虑文档目录,但后来我看到Apple现在想要将数据存储在缓存目录中。

I have an app that allows me to download characters (images), sounds, etc. When the user chooses which character to download can I store that in a directory in my App Bundle? If not, where is the best place to store my content (data)? I was thinking the documents directory, but then I saw somewhere that Apple now wants data stored in the caches directory.

感谢您的帮助。

推荐答案


我可以将它存储在App Bundle的目录中吗?

can I store that in a directory in my App Bundle?

不,你不能修改应用程序包。

No, you can not modify the app bundle.


如果没有,哪里是最好的地方存储我的内容(数据)?

If not, where is the best place to store my content (data)?




  • 如果您的应用必须支持iOS 5.0或更早版本,您需要将您的应用数据存储在 Caches 目录中。但是,请记住,在低空间情况下可以删除文件,因此如果您的应用数据被删除,您的应用将需要优雅地降级。

    • If your app must support iOS 5.0 or earlier, you will need to store your app data in the Caches directory. However, keep in mind the files could be deleted in low space situations so your app will need to degrade gracefully if your app data is deleted.

      从iOS开始5.0.1,您可以将数据文件存储在文档目录中,并且将它们标记为不备份。通过标记文件,您的应用程序符合应用程序负责确保仅将用户数据而非应用程序数据备份到iCloud和iTunes 的准则,并避免Apple可能拒绝。在这种情况下,在低空间情况下不会删除文件。

      As of iOS 5.0.1, you can store your data files in the Documents Directory and flag them as "do not back up". By flagging the files, your app complies with the guideline that apps are responsible for ensuring that only user data and not application data is backed up to iCloud and iTunes and avoids a possible rejection by Apple. In this case, the files will not be deleted in low space situations.

      从iOS 5.1开始,您可以将数据文件存储在文档目录中并使用 NSURLIsExcludedFromBackupKey kCFURLIsExcludedFromBackupKey 从备份中排除文件的文件属性。这些API中的任何一个都优先于将它们标记为不备份。在这种情况下,您的应用程序符合App Store指南,并且在低空间情况下不会删除这些文件。

      As of iOS 5.1, you can store your data files in the Documents Directory and use either NSURLIsExcludedFromBackupKey or kCFURLIsExcludedFromBackupKey file properties to exclude files from backups. Either of these APIs is preferred over flagging them as "do not back up". In this case, your app complies with the App Store guidelines and the files will not be deleted in low space situations.

      这篇关于可以将下载的图像/文件添加到我的应用包中吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆