iOS in-depth understanding of Controller view loading

Source: Internet
Author: User

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

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.