Skip to main content

Posts

Showing posts with the label release

UIWebView - When (or how) does CFData get released?

after multiple days of banging my head against the wall and having sleepless nights I'm hoping to find some help here. I've gone through various posts here, but none of the answers seem to provide a resolution for me. In short, my problem is that my App crashes after heavy usage (>10min) of the UIWebView (e.g. opening larger news paper sites in series - one after the other). To give more details: I am writing an iPhone App and from the MainViewController I push a browserViewController on the navigationController. The browserViewController loads a nib which contains a UWebView (I do not create the WebView programatically). The UIWebView is wired up using Interface Builder. When going back to Main and then going again to the browserViewController, I only recreate the browserViewController if it is nil. (I want to keep the content that is loaded i the UIWebView - only if there is a memory warning shoud this view be unloaded and release all memory used). In both, MainV

Memory is not released even though I explicitly release it

I am in the process of optimizing my app and making sure memory management is properly implemented. As I found the didUnload / dealloc / willAppear not reliable for implementing my memory cleanup, I decided to implement my own method so I can have full control of this memory management. Definition of my arrays in the header file @property (retain) NSMutableArray *selectedCardIDs; @property (retain) NSMutableArray *selectedRowArray; @property (retain) NSMutableArray *cardArray; @property (retain) NSMutableArray *cardIDArray; Here the release method: - (void) willReleaseObjects { [self.aCopyOfCardIDArray release]; [self.listOfItems release]; [self.aCopyListOfItems release]; [self.selectedCardIDs release]; [self.selectedRowArray release]; [self.cardArray release]; [self.cardIDArray release]; } The arrays can get very large (> 1'000 entry each), why a release of those arrays is essential after the view is unloaded. I explicitly call this function in the IBAction method, su