耶!!

你总是这样轻言放弃的话,无论过多久都会在原地踏步

UIWebView清除缓存和cookie

UIWebView清除Cookie:

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

UIWebView清除缓存:

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

或者用下面的代码

NSURLCache * cache = [NSURLCache sharedURLCache];  
    [cache removeAllCachedResponses];  
    [cache setDiskCapacity:0];  
    [cache setMemoryCapacity:0];  

阅读更多
个人分类: UIWebView
上一篇定制导航栏
下一篇随笔
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭