웹보기를 열 때 메모리가 100M으로 점프합니다. 웹보기를 닫고 모든 캐시를 제거 할 때 잠시 무시하면 메모리는 절대로 원래 위치로 내려 가지 않고 10M 만 감소합니다. 나는 새로운 앱을 시작하려고 노력했다. 깨끗하고, 나는 그것을 체크했고, 여전히 발생한다. 간단한 웹보기를 설정할 수 없습니다. 메모리가 영구히 유지되기 때문입니다.ios7에서 webView를 사용하는 심각한 버그
NSURL *websiteUrl = [NSURL URLWithString:[Globals sharedGlobals].currentLink];
urlRequest = [NSURLRequest requestWithURL:websiteUrl cachePolicy:NSURLRequestReloadIgnoringLocalAndRemoteCacheData timeoutInterval:10];
[self.webView setDelegate:self];
self.webView.scalesPageToFit = YES;
[self.webView loadRequest:urlRequest];
보십시오을 재현하기 위해, 당신은 같은를 얻을 것이다 : URL을로드
[self.webView loadHTMLString: @"" baseURL: nil]; //tried with/without it
[[NSURLCache sharedURLCache] removeCachedResponseForRequest:urlRequest];
[[NSURLCache sharedURLCache] removeAllCachedResponses];
[[NSURLCache sharedURLCache] setDiskCapacity:0];
[[NSURLCache sharedURLCache] setMemoryCapacity:0];
NSURLCache *sharedCache = [[NSURLCache alloc] initWithMemoryCapacity:0 diskCapacity:0 diskPath:nil];
[NSURLCache setSharedURLCache:sharedCache];
urlRequest=nil;
for(NSHTTPCookie *cookie in [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookies])
if([[cookie domain] isEqualToString:[Globals sharedGlobals].currentLink])
[[NSHTTPCookieStorage sharedHTTPCookieStorage] deleteCookie:cookie];
[self.webView removeFromSuperview];
[self.view removeFromSuperview];
:
캐시를 삭제하기 전에 웹보기를 제거합니다. 메모리가 올라가고 내려 가지 않습니다.
여기 있습니다. 귀하의 질문에 충분히 소리 것, 그리고 downvote 공정하다고 생각하지 않았다. 그뿐만 아니라 현재 당신이 싫어하는 것과 비슷한 문제가 있습니다. 그러나 사람들은 자신이 좋아하는 방식으로 투표 할 것이고, 그것에 대해 할 수있는 일은 아무것도 없기 때문에 때때로 그렇게 실망하게됩니다. – trudyscousin
@trudyscousin, 당신은 그 문제를 해결할 수 있습니까? 나는 6 시간을 보냈고 모든 정보를 읽었다. 결과가 없습니다. – Curnelious
메모리가 증가 할뿐만 아니라 캐시를 비울 때 충돌이 발생합니다. 그래, 난 아직도 내 일을하고있어 ... – trudyscousin