iOS开发 SDWebImage 获取缓存与清除缓存

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/ljc_563812704/article/details/84071409

获取缓存:

    //获取缓存图片的大小(字节)

    NSUInteger bytesCache = [[SDImageCache sharedImageCache] getSize];

    //换算成 MB (注意iOS中的字节之间的换算是1000不是1024)

    float MBCache = bytesCache/1000.00/1000.00;

清除缓存:

            dispatch_async(dispatch_get_global_queue(0, 0), ^{

               [[SDImageCache sharedImageCache] clearDiskOnCompletion:nil];

            });

猜你喜欢

转载自blog.csdn.net/ljc_563812704/article/details/84071409
今日推荐