2014-06-17 2 views
0

내 앱에서 사용자는 링크를 방문 할 수 있습니다. 나는 in-app 브라우저를 사용한다. 그러나 사용자가 사이트를 방문하면 메모리 사용량이 25MB에서 50MB로 증가하고 사용자가 브라우저를 닫거나 이전 화면으로 돌아 오더라도 줄어들지 않습니다. 내 AppMainBrowserViewController에서인앱 브라우저는 iOS에서 메모리 사용량을 증가시킵니다.

AppMainBrowserViewController *mainBrowser = [[AppMainBrowserViewController alloc] initWithNibName:@"AppMainBrowserViewController" bundle:nil]; 
    mainBrowser.urlString = urlString; 
    [self.navigationController pushViewController:mainBrowser animated:YES]; 

:

if ([InternetDetector isNetAvailable]) { 

    if (self.processingIndicatorAlertView == Nil) { 
     [self showIndicatorView]; 
    } 

    //Request 
    NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:self.urlString]]; 
    [self.mainWebView loadRequest:request]; 
} else { 

    UIAlertView *errorAlert = [[UIAlertView alloc] initWithTitle:ALERT_TITLE_MSG message:INTERNET_NOT_FOUND_MSG delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; 
    [errorAlert show]; 
} 

내가 잘못 가고

여기에 내가 브라우저를 열고 사용하고있는 간단한 코드는?

답변

0

아마도 이것은 NSURLCache의 캐시 때문일 수 있습니다. 인앱 브라우저를 시작하기 전에 캐쉬를 0으로 설정하십시오.

int cacheSizeMemory = 0; 
    int cacheSizeDisk = 0; 
    NSURLCache *sharedCache = [[NSURLCache alloc] initWithMemoryCapacity:cacheSizeMemory diskCapacity:cacheSizeDisk diskPath:@"nsurlcache"]; 
    [NSURLCache setSharedURLCache:sharedCache]; 
+0

동일한 메모리가 사용됩니다. – iBug

관련 문제