IOS Study Notes 7-uiviewcontroller

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.