Viewcontroller Study Notes

Source: Internet
Author: User

The steps that occur during the load cycle are as follows:

  1. Some part of your application asks for the view in the View Controller'sViewProperty.

  2. If the view is not currently in memory, the View Controller callitsLoadviewMethod.

  3. the loadview method does one of the following:

    ● If you override this method, your implementation is responsible for creating all necessary views and assigning a non-nil value to the View property.

    ● if you do not override this method, the default implementation uses the nibname and nibbundle Properties of the View controller to try to load the view from the specified NIB file. if the specified NIB file is not found, it looks for a NIB file whose name matches the name of the View Controller class and loads that file.

    ● if no NIB file is available, the method creates an empty uiview object and assigns it to the View property.

  4. The View Controller callitsViewdidloadMethod to perform any additional load-time tasks.

The steps that occur during the unload cycle are as follows:

  1. The application has es a low-memory warning from the system.

  2. Each View Controller CILS its Didreceivememorywarning Method:

    • ●If you override this method, you should use it to release any custom data that your view controller object no longer needs. you shoshould not use it to release your view controller's view. you must call Super At some point in your implementation to perform the default behavior.

    • ●The default implementation releases the view only if it determines that it is safe to do so.

  3. If the View Controller releases its view, it callits Viewdidunload Method. You can override this method

    To perform any additional cleanup required for your views and view hierarchy.

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.