码迷,mamicode.com
首页 > 移动开发 > 详细

ios webview清除缓存

时间:2015-05-29 11:33:27      阅读:402      评论:0      收藏:0      [点我收藏+]

标签:

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)

分类: ios
[cpp] view plaincopy
 
 
  1. NSURLCache * cache = [NSURLCache sharedURLCache];  
  2.     [cache removeAllCachedResponses];  
  3.     [cache setDiskCapacity:0];  
  4.     [cache setMemoryCapacity:0];  

ios webview清除缓存

标签:

原文地址:http://www.cnblogs.com/gaohe/p/4537820.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!