我正在显示从Web下载的图标列表,其中包含表格视图中的文本.可以在服务器端更改图标,我需要在新图标可用时立即更换它们.我尝试使用以下代码:
[imgView setImageWithURL:url placeholderImage:[UIImage imageNamed:@"table_avatar_icon"] options:SDWebImageCacheMemoryOnly];
Run Code Online (Sandbox Code Playgroud)
并调用[[SDImageCache sharedImageCache] clearMemory];我的刷新回调,但它不会清除缓存的内容.更重要的是,即使我关闭应用程序并再次打开它,图像仍然存在.
我发现只有一种方法可以清除缓存,而是通过调用[[SDImageCache sharedImageCache] clearDisk];.这仅在我关闭并重新打开应用程序后才有效.
如何强制SDWebImage不使用磁盘缓存?
cacheMaxCacheAge使用 SDWebImage 时如何更改静态值?有什么办法好呢?我需要将图像缓存 5 分钟。