您的位置:首页 > 其它

一般使用SDWebImage 进行图片的显示和缓存,一般缓存的内容比较多了就需要进行清空缓存

2016-05-12 16:54 501 查看
// 清理内存

[[SDImageCache sharedImageCache] clearMemory];

// 清理webview 缓存

NSHTTPCookieStorage *storage = [NSHTTPCookieStorage sharedHTTPCookieStorage];

for (NSHTTPCookie *cookie in [storage cookies]) {

[storage deleteCookie:cookie];

}

NSURLSessionConfiguration *config = [NSURLSessionConfiguration defaultSessionConfiguration];

[config.URLCache removeAllCachedResponses];

[[NSURLCache sharedURLCache] removeAllCachedResponses];

// 清理硬盘

[[SDImageCache sharedImageCache] clearDiskOnCompletion:^{

[MBProgressHUD hideAllHUDsForView:self.view animated:YES];

[self.tableView reloadData];

}];
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: