Several important methods of iOS

Source: Internet
Author: User

Load class to memory, called when the program is just started, call before the main function

1.+ (void) load{

}

Initializes the class, which is called once when the class is used for the first time

2.+ (void) initialize{

}

Controller's view schema, setting the controller's root view, overriding this method, the storyboard file will no longer work

3.-(void) loadview{

}

View load Complete

4.-(void) viewdidload{

}

The view will appear

5.-(void) Viewwillappear: (BOOL) animated{

}

This method is called when using files such as Xib/storyboard.

6.-(ID) Initwithcoder: (Nscoder *) adecoder{

}

Called when the load Xib is complete, after 6. When using Xib, we can add components dynamically in the 6&7 two methods.

7.-(void) awakefromnib{

}

When creating a control with a hand code, we typically add components & set some of its own properties in this method dynamically. External calls to the Init method, the system will also automatically call this method

8.-(Instancetype) initWithFrame: (CGRect) frame

{

} generally we calculate the frame in this method, which is the control's last layout child control, which calculates the most accurate

9.-(void) layoutsubviews{

}

Several important methods of iOS

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.