UIWebView清除缓存和cookie

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)

posted @ 2012-11-08 23:10  ItNoob  阅读(4240)  评论(1编辑  收藏  举报