gpt4 book ai didi

iphone - iPhoneOS 会自动清除库/缓存吗?

转载 作者:行者123 更新时间:2023-12-03 19:15:14 24 4
gpt4 key购买 nike

我有一个应用程序需要缓存一些图像。

我已经阅读了一些有关缓存的文档,合乎逻辑的做法是将我的图像缓存在应用程序沙箱的 Library/Caches 目录中。

据我所知,在这里存储缓存图像的原因是:

  • iTunes 不备份资料库/缓存
  • 操作系统定期清除库/缓存

第二点是我质疑的......

  • 这是真的吗?
  • 操作系统会自动清除缓存目录吗?
  • 我是否需要自己的逻辑来检测缓存是否太大并清除最旧的项目?

最佳答案

我在文档中找到了这个:

Use this directory to write any application-specific support files that you want to persist between launches of the application. Your application is generally responsible for adding and removing these files. However, iTunes removes these files during a full restore of the device so you should be able to recreate them as needed. To access this directory, use the interfaces described in “Getting Paths to Application Directories” to get the path to the directory. In iPhone OS 2.2 and later, the contents of this directory are not backed up by iTunes.

http://developer.apple.com/iphone/library/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/FilesandNetworking/FilesandNetworking.html

关于iphone - iPhoneOS 会自动清除库/缓存吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2061655/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com