Uiapplicationmain, UIApplication detailed

Source: Internet
Author: User

Uiapplicationmain This function is mainly responsible for three things:

1) Initializes the application object from the given class name, which is an instance of initializing the UIApplication or subclass object , and if you are given nil here, the system defaults to the UIApplication class, It is primarily this class that controls and coordinates the operation of the application. In subsequent work, you can use the static method sharedapplication to get the handle of the application.

2) Initializes an application delegate (Uiapplicationdelegate)from the given application delegate class. and set the delegate to the application's delegate, here is if the passed parameter is nil, the function is called to access the Info.plist file to find the main nib file, get the application delegate.

3) start the main event loop and start receiving events.

Second, uiapplication (or subclass) the responsibility of the object, this object mainly do the following several things:

1) is responsible for handling incoming user events and distributing event messages to the target object (sender, action) that should process the message.


2) manage and control views, including rendering, control behavior, current display view , and more.


3) The object has an application delegate object that the application notifies when important events (which can include system events or life cycle control events) occur during some life cycles . For example, application startup, insufficient memory, or application completion, and so on, when these events occur, the application delegates to respond.

Uiapplicationmain, UIApplication detailed

Related Article

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.