Xcode: SDWebImage clear cache for single image

前端 未结 2 758
感情败类
感情败类 2021-02-19 05:00

I\'m using SDWebImage to asynchronous image downloader with cache support.

It\'s working perfectly except that sometimes the image got updated on the server with same na

相关标签:
2条回答
  • 2021-02-19 05:17
    #import "SDImageCache.h"
    
    ....
    
    [[SDImageCache sharedImageCache] removeImageForKey:@"http://domain.com/image.jpg" fromDisk:YES];
    
    0 讨论(0)
  • 2021-02-19 05:18
    - (void)removeImageForKey:(NSString *)key fromDisk:(BOOL)fromDisk;
    

    API is right. It work for me. Do you know the api is in class SDImageCache which is a singleton class.
    You could use it like this:

    [[SDImageCache sharedImageCache] removeImageForKey:image_url fromDisk:YES];
    
    0 讨论(0)
提交回复
热议问题