UIView objects are generally created by the Alloc and Init methods and are maintained and managed by Uiviewcontroller. Tasks that you typically need to accomplish are: Create a view, display a view, hide the view, and release the view.
The normal view is not created and loaded immediately when the program is run, and is created only when the application needs this view, and this delay in creating the view can improve the efficiency of memory usage. Again, before this view is needed, the system checks if the view has been loaded, if so, directly returns the created view, and if not, starts the creation process
-(void) Loadview
Executing code during Load view
-(void) viewdidload
View load complete code that needs to be executed
-(void) viewdidunload
Uninstalling View Code
When one view switches to another view, the previous view is not purged and remains in memory waiting for system calls, so a view may appear multiple times during use to uninstall, but only once, that is, call the Loadview and Viewdidload methods once.
Before IOS6, the Viewdidunload method was invoked when the system received the memory warning, and the view was unloaded and emptied. But this method is no longer used after IOS6, as described in the document.
The explanation given here is that the view is no longer erased in low memory. Apple WWDC2012 's farewell statement on this approach
The method Viewwillunload and Viewdidunload. We ' re not going to call them anymore. I mean, there ' s kind of a cost-benifit equation and analysis that we went through. In the early days, there is a real performance need for us to ensure this on memory we warnings our views. There is all kinds the graphics and backing stores and so forth to that would to get also. We now unload those independently of the "view, so it isn ' t" big of "a" deal for us for those to is unloaded, and there W ere so many bugs where there would is pointers into.
Specifically why not need to empty view, the following explains the reason (excerpt from the "Goodbye, Viewdidunload Method")
1.UIView has a Calayer member variable, Calayer is specifically used to draw itself to the screen. As shown in the following illustration: