iphone - 应用程序打开时,系统是否可以删除 NSCachesDirectory 的内容?

标签 iphone ios objective-c

作为标题。

我存储在 NSCachesDirectory 中的文件是否有可能被系统删除(即在低存储情况下),当我在前台运行时?

最佳答案

File System programming guide

On iOS 5.0 and later, the system may delete the Caches directory on rare occasions when the system is very low on disk space. This will never occur while an app is running. However, you should be aware that iTunes restore is not necessarily the only condition under which the Caches directory can be erased.

所以答案是 - 不,当应用程序在前台运行时,NSCachesDirectory 是不可能被删除的。

但是,关于在后台运行的应用程序,他们的措辞有些含糊。

关于iphone - 应用程序打开时,系统是否可以删除 NSCachesDirectory 的内容?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14609266/

相关文章:

ios - 标签的 UIButton 文本不可见

ios - 如果在 iOS 8 中使用搜索栏找不到结果,如何隐藏部分标题

iphone - UIButton setTitleColor 和 setImage 不起作用

iphone - 使用ios sdk将视频上传到youtube的方法

ios - 将格式化日期转换为 NSDate

iphone - AFNetworking - 下载多个文件 + 通过 UIProgressView 监控

iphone - 使用 colorWithPatternImage 时 UIView 的动画背景颜色

ios - UIImagePickerController With Camera Option in landscape mode in iphone SDK

ios - Mogenerator和Xcode 4优点/缺点

javascript - 使用 javascript 将 HTML 注入(inject) iPhone 网页的末尾