YYWebImage清除缓存


    YYImageCache *cache = [YYWebImageManager sharedManager].cache;

    float tmpSize =  cache.diskCache.totalCost / 1024 /1024;

    NSString *clearCacheName = tmpSize >= 1 ? [NSString stringWithFormat:@"清理缓存(%.2f M)",tmpSize] : [NSString stringWithFormat:@"清理缓存(%.2f K)",tmpSize * 1024];
    [cache.memoryCache removeAllObjects];
    [cache.diskCache removeAllObjects];
     NSLog(@"%l@",[NSString stringWithFormat:@"已%@",clearCacheName]);

LEAVE A REPLY
总访问数 146
loading