SDWebImage获取和清除缓存大小

#pragma mark ---获取缓存的大小 ---
- (void) getSizeCache{
    CGFloat size = [SDImageCache sharedImageCache].getSize / 1000.0 /1000;
    [self.cancelCacheButton setTitle:[NSString stringWithFormat:@"    缓存大小为:%.2fMB", size] forState:UIControlStateNormal];
}

#warning mark --- 点击清除缓存实现的方法 ---
- (IBAction)cancelCache:(id)sender {
    [[SDImageCache sharedImageCache] clearDisk];
    [self.cancelCacheButton setTitle:@"    缓存大小为:0.00MB" forState:UIControlStateNormal];
}

 

posted @ 2016-04-25 09:17  aRenOuBa  阅读(353)  评论(0编辑  收藏  举报