To release a method that references another view, follow these steps.
1) uiviewcontroller A is the master View Controller; B is the subview controller.
2) A creates B's instance and stores B's reference.
3) A adds B's view to a's subview.
Everything is normal. We can see that B is correctly displayed in a's view.
4) A removed B view. B view does not have any reference in the code.
5) Call didreceivememorywarning (through analog or manual call ).
If you do not do this after 3.0, you do not need to reload this function and place the code for memory release in viewdidunload.
The default implementation of this function is to check whether the controller can safely release it.View(Bold hereViewIt refers to the Controller'sViewAttribute), suchViewThere is no superview itself and it can be easily reconstructed (from nib or loadview functions ).
IfViewThis function can be released.ViewAnd call viewdidunload.
You can reload this function to release other memory used in the controller. But remember to call the super implementation of this function to allow the parent class (usually uiviewcontroller) to be released.View.
If your viewcontroller savesViewIn earlier versions of IOS, you should release these references in this function. In ios3.0 or later, you should release these references in viewdidunload.
By Bruce Lee
Source: http://www.cnblogs.com/BruceLee521
This blog Original article is copyrighted by the blog and I share it with you. You are welcome to reprint it. However, you must keep this statement without the author's consent and provide the author name and original article connection clearly on the article page, otherwise, you are entitled to pursue legal liability.