SDWebImage中的SDImageCache
获取当前缓存大小:
//字节大小
int byteSize = (int)[SDImageCache sharedImageCache].getSize;
//M大小
CGFloat cacheSize = byteSize / 1000.0 / 1000.0;
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"清理缓存" message:[NSString stringWithFormat:@"缓存大小%.1fM",cacheSize] delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil];
[alert show];
清除缓存:
//清除缓存
[[SDImageCache sharedImageCache] clearDisk];