In the interview, the interviewer may ask such questions, what is the role of Loadview, and how does it differ from viewdidload?
First we need to know that the controller view is loaded by lazy loading, that is, when it is used to load.
Loadview method
When we use the Controller view, we call the controller view's Get method, inside the Get method, first determine whether the view has been created, if it already exists, directly return the existing view, if not, then call the controller's Loadview method, Loadview may also be executed multiple times if the controller is not destroyed
Viewdidload method
When the Loadview method of the controller is executed, the view is created successfully and the Viewdidload method is executed, which, like the Loadview method, can be executed multiple times. In development, we may never have encountered the execution of many times, when will be executed several times?
http://www.jianshu.com/p/23a83706d773
Note that the console prints as shown
iOS in-depth understanding of Controller view loading