// cookie清除
NSHTTPCookie *cookie;
NSHTTPCookieStorage *storage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
for (cookie in [storage cookies])
{
[storage deleteCookie:cookie];
}
// 缓存 清除
// [[NSURLCache sharedURLCache] removeAllCachedResponses];
NSURLCache * cache = [NSURLCache sharedURLCache];
[cache removeAllCachedResponses];
[cache setDiskCapacity:0];
[cache setMemoryCapacity:0];
[_web loadHTMLString:@"" baseURL:nil];
[_web stopLoading];
[_web removeFromSuperview];
_web = nil;
清除cookie和缓存都没有用,只要使用了一个UIWebView就始终占用一定的内存。
跪求解决~~