Comparison of IOS Load method and Initialize method

Source: Internet
Author: User

First, the Load method features:

1. This function is executed when the class is referenced into the program

2. The Load method of a class does not specify [super Load], the parent class receives the call, and precedes the subclass.

3. The category load will also receive calls, but sequentially after the main class's load call.

Second, Initialize method features:

1, Initialize's natural call is the first time to actively use the current class

2, and load is different, even if the subclass does not implement the Initialize method, the implementation of the parent class will inherit the call over. Note that before this, the method of the parent class has been executed once, and no super call is required.

3, if there is initialize method in the classification, initialize in the class is no longer called, call the Initialize method in the classification directly

Three, load and initialize have a lot of common characteristics, the following simple list

1, the system will be called at most once without considering the active use of the developer

2, if both the parent class and the child class are called, the call of the parent class must precede the child class

3, all for the application to run in advance to create the appropriate running

Comparison of IOS Load method and Initialize 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.