If your view controller stores references to views and other custom objects, it is also responsible for relinquishing ownership of those objects safely in itshttp://developer.apple.com/library/ios/#documentation/uikit/reference/UIViewController_Class/Reference/Reference.htmldealloc
method. If you implement this method but are building your application for iOS 2.x, yourdealloc
method should release each object but should also set the reference to that object tonil
before callingsuper
.
Wednesday, May 25, 2011
ViewDidUnload is Not Being Called
ViewDidUnload gets called after the view is nil. This method gets called when memory is low. If you try to release an Ad object like Mobfox or AdMob in this method instead of the dealloc method, the objects may not get released and you may receive a EXEC_BAD_ACCESS error after you leave the page. This is because the Ad is still trying to show on the view which has been deallocated already.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment