Objective c 为什么SDWebImage会导致diskCache而不是memoryCache?
我使用Objective c 为什么SDWebImage会导致diskCache而不是memoryCache?,objective-c,Objective C,我使用SDWebImage加载图像,但它不是memoryCache,而是diskCache。 我是这样做的: [imgView sd_setImageWithURL:[NSURL URLWithString:urlStr]]; Bool isINMemoryCache = ([[SDImageCache sharedImageCache] imageFromMemoryCacheForKey:urlStr] != nil); 当您再次加载并获得isINMemoryCache时,您将始
SDWebImage
加载图像,但它不是memoryCache
,而是diskCache
。
我是这样做的:
[imgView sd_setImageWithURL:[NSURL URLWithString:urlStr]];
Bool isINMemoryCache = ([[SDImageCache sharedImageCache]
imageFromMemoryCacheForKey:urlStr] != nil);
当您再次加载并获得
isINMemoryCache
时,您将始终获得否
。这是为什么?SDWebImage将映像异步存储到内存和磁盘缓存中
请参阅此代码:
标题和问题的改进