webView清除缓存

来源:互联网 发布:js用数字图片表示时间 编辑:程序博客网 时间:2024/05/29 13:23

转自 http://blog.csdn.net/zhaoweixing1989/article/details/13021571

UIWebView清除Cookie:

复制代码
//清除cookiesNSHTTPCookie *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)

分类: ios 1013人阅读 评论(0) 收藏 举报
[cpp] view plaincopy
  1. NSURLCache * cache = [NSURLCache sharedURLCache];  
  2.     [cache removeAllCachedResponses];  
  3.     [cache setDiskCapacity:0];  
  4.     [cache setMemoryCapacity:0];  
0 0
原创粉丝点击