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

ios webview清除缓存

2015-05-29 10:08 330 查看
UIWebView清除Cookie:



//清除cookies
NSHTTPCookie *cookie;
NSHTTPCookieStorage *storage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
for (cookie in [storage cookies])
{
[storage deleteCookie:cookie];
}




UIWebView清除缓存:

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


(By ItNoob.Matrix 链接 http://www.cnblogs.com/ItNoob)
分类: ios2012-12-24 11:17 1013人阅读 评论(0) 收藏 举报

[cpp] view plaincopy

NSURLCache * cache = [NSURLCache sharedURLCache];

[cache removeAllCachedResponses];

[cache setDiskCapacity:0];

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