UI advanced--the creation process of the Controller view and the life cycle method

Source: Internet
Author: User

The creation process of the Controller view:

1, first load Loadview,if any, that is, according to the code inside the creation;

2loadview No relevant code, based on main.storyboard< Span style= "Font-family:simsun;" lang= "ZH-CN" > file to create, Main.storyboard There is, according to the description inside create

3,Main.storyboard inside no related interface, then will find nibname xib file, if there is, that is, based on the interface created;

4, if the nibname file can not be found, then will find view.xib files, if any, that is, based on the interface created;

5, if there is no viw.xib, then directly find the viewcontroller.xib file, if so, that is, based on the interface created;

6, if there is no viewcontroller.xib, then the window will create a blank view.

As shown in the following examples:

Life cycle Methods for controller view:

Viewdidload:view Loading complete

Viewwillappear:view is about to show

Viewdidappear:view Display Complete

Viewwilldisappear:view is about to disappear.

Viewdisappear:view has disappeared.

Viewreceivememorywarning:view Receiving Memory warning

Viewwillunload:view will unload-----Ask to uninstall the view that is not currently displayed in the

Uninstall view

Viewdidunload:view has been uninstalled this method is automatically called by the system before ios5, and is no longer available.

If the view needs to be displayed again, then it will execute, Loadview method, and re-make a new life cycle.

UI advanced--the creation process of the Controller view and the life cycle method

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.