YYCache icon indicating copy to clipboard operation
YYCache copied to clipboard

为什么有时候读取出来的cache为空?

Open DarielChen opened this issue 9 years ago • 2 comments

2016-08-09 15:12:39.251 Cache[8395:623370] object:(null) 2016-08-09 15:12:39.426 Cache[8395:623370] object:(null) 2016-08-09 15:12:39.594 Cache[8395:623370] object:(null) 2016-08-09 15:12:39.747 Cache[8395:623371] object:(null) 2016-08-09 15:12:39.943 Cache[8395:623371] object:( "<PersonModel: 0x7f92a27cdea0>", "<PersonModel: 0x7f92a27cad90>", "<PersonModel: 0x7f92a27cb8d0>", "<PersonModel: 0x7f92a27adc60>", "<PersonModel: 0x7f92a2715ab0>", "<PersonModel: 0x7f92a2713490>" ) 2016-08-09 15:12:40.363 Cache[8395:623371] object:(null) 2016-08-09 15:12:41.188 Cache[8395:623371] object:(null)

DarielChen avatar Aug 09 '16 07:08 DarielChen

可能有很多原因:

  • Object 没有实现 NSCoding 协议,或者实现有问题
  • 缓存达到上限被清理(age、cost、count)
  • 磁盘缓存被系统清理并重启了 App
  • 使用方法错误
  • 其他问题

ibireme avatar Aug 11 '16 13:08 ibireme

在子线程中创建yydiskcache对象并取值时,缓存对象被清除

frankfan1990 avatar Sep 06 '17 03:09 frankfan1990