您的位置:首页 > 移动开发

清除UIWebView缓存

2015-10-06 14:13 363 查看
//清除cookies
NSHTTPCookie *cookie;
NSHTTPCookieStorage *storage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
for (cookie in [storage cookies])
{
[storage deleteCookie:cookie];
}
//退出登录实现

//清除UIWebView的缓存
[[NSURLCachesharedURLCache] removeAllCachedResponses];

NSURLCache * cache = [NSURLCache sharedURLCache];

[cache removeAllCachedResponses];

[cache setDiskCapacity:0];

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