现在的位置: 首页 > 综合 > 正文

UIWebView清除缓存和Cookie

2018年09月07日 ⁄ 综合 ⁄ 共 320字 ⁄ 字号 评论关闭

肖锐(Cooki)个人原创,欢迎转载,转载请注明地址,肖锐(Cooki)的技术博客 http://blog.csdn.net/xiao0026

UIWebView清除缓存:

 

加入以下代码:

[[NSURLCache sharedURLCache] removeAllCachedResponses];

清除Cookie  //有点像我的名字,哈哈

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

抱歉!评论已关闭.