您的位置:首页 > 移动开发

(问题)如何彻底清除UIWebView的内存消耗

2014-07-27 22:47 197 查看
// 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就始终占用一定的内存。

跪求解决~~
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  UIWebView