//清除缓存 [self showAlertWithTitle:QHLocalizedString(@"确认清除缓存", nil) message:nil actions:@[QHLocalizedString(@"取消", nil), QHLocalizedString(@"确认", nil)] complete:^(NSInteger selIndex) { if (selIndex == 1) { //获取缓存图片的大小(字节)// NSUInteger bytesCache = [[SDImageCache sharedImageCache] getSize]; //换算成 MB// float MBCache = bytesCache/1000/1000; //异步清除图片缓存 (磁盘中的) dispatch_async(dispatch_get_global_queue(0, 0), ^{ [[SDImageCache sharedImageCache] clearDisk]; }); __weak typeof(self) weakSelf = self; [[SDImageCache sharedImageCache] clearDiskOnCompletion:^{ __strong typeof(weakSelf) strongSelf = weakSelf; [MBProgressHUD showMessag:QHLocalizedString(@"清除成功", nil) toView:strongSelf.view afterDelay:hiddenMBPTime]; }]; } }];