什么时候NSCachesDirectory文件被删除? [英] When are files from NSCachesDirectory removed?

查看:225
本文介绍了什么时候NSCachesDirectory文件被删除?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在什么情况下,iOS NSCachesDirectory中的文件被删除?显然,删除并重新安装一个应用程序。应用程序升级怎么样?低磁盘空间条件呢?还有什么?

解决方案

我们的经验是,这个文件夹得到清除应用程序更新。这将是很高兴知道什么时候这个文件夹是一个候选人被清除。文档描述这个文件夹为

lockquote

可放弃缓存文件的位置(Library / Caches)


$ b $ NSDocumentDirectory 在应用程序更新时不会被清除,但要小心使用此文件夹,因为iOS 5现在使用此文件夹进行备份如果您使用此目录存储用户生成的内容以外的任何内容,则iCloud和您的应用可能会被拒绝。

In what circumstances would files in the iOS NSCachesDirectory get removed? Obviously, delete and reinstall an application. What about application upgrade? What about low disk space conditions? Anything else?

解决方案

Our experience is that this folder gets cleared on app updates. It would be nice to know when exactly this folder is a candidate for being cleared. The docs describe this folder as

location of discardable cache files (Library/Caches)

The NSDocumentDirectory will not be cleared on app updates but be careful using this folder since iOS 5 now uses this folder for backing up in iCloud and your app will likely be rejected if you use this directory to store anything other then user generated content.

这篇关于什么时候NSCachesDirectory文件被删除?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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