Thursday 15 April 2010

iphone - Memory leaks with UIWebView and NSURL: already spent several days trying to solve them -


I have got a lot of information about how to solve memory leaks for iPhone ob c code. The last two leaks are troubling me, I'm probably ignoring some that you can see it.

CGRectMake (0.0, 0.0, self.view.bounds.size.width, self.view.bounds.size.height - LOWER_VERT_WINDOW_MARGIN)]; (2) webView.scalesPageToFit = Yes; (3) webView.dataDetectorTypes = UIDataDetectorTypeNone; (4) (5) NSDRAEL * URL = [NSUr file URLWithPath: self.fullPathFileNameDirectory: NO]; (6) NSMutableURLRequest * urlRequest = [[NSMutableURLRequest alloc] initWithURL: url]; (7) [Webview LoaderWeost: urlRequest]; (8) [urlRequest release], urlRequest = zero; (9) [self.view addSubview: webView]; (10) [Webview release], webview = zero;

The device claims that 128 bytes are leaking in line 1, as well as 256 bytes in line. No idea if it means line 3 or row 5.

What is a clue what I see?

1) Make sure you are leaking tests on any device and not a simulator

2) If not, try setting the URL cache by adding it to your app representative:

  NSURLCache * sharedCache = [[NSUrCatch Alloc] InitWithMemory Capacity: 0 Disk Capacity: 0 disk path: zero]; [NSURLCache setSharedURLCache: shared cache]; [Shared cash release];  

No comments:

Post a Comment