UIWebView 清除缓存
2015-04-02 本文已影响6055人
Tracey
//清除cookies
NSHTTPCookie *cookie;
NSHTTPCookieStorage *storage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
for (cookie in [storage cookies])
{
[storage deleteCookie:cookie];
}
// 清除webView的缓存
[[NSURLCache sharedURLCache] removeAllCachedResponses];
一般这样就能删除UIWebView 中的缓存。