Uiviewcontroller inherits uiresponder, while uiresponder inherits nsobject. uiviewcontroller is the parent class of all view controllers.
In MVC mode, uiviewcontroller plays the role of C (Controller) to control views and model operations.
If a project is created or a viewcontroller is associated. initialize the XIB file in the viewdidload method. XIB view, you need to create a view controller from loadview.
Simple Life Cycle of viewcontroller:
Loadview: Create a View Controller (if not loaded from. XIB)
Viewdidload: View loaded
Viewwillappear: Run view before loading
Viewwilldisappear: run the view before it disappears (disabled or overwritten)
Willrotatetointerfaceorientation: Duration: Run when rotation starts
Didrotatetointerfaceorientation: Run when rotation ends
Differences between loadview and viewdidload:
Loadview is called when the view is initialized. It is called only once after the application is enabled.
Viewdidload is called every time you enter a view.
To join our QQ group or public account, see: Ryan's
Zone public account and QQ Group