Full boot process for iOS

Source: Internet
Author: User

iOS launcher can load flowcharts:

1. Execute the main function first, and the Uiapplicationmain function will be called inside main

What does the 2.UIApplicationMain function do:

1> Creating UIApplication Objects

2> creating a UIApplication Delegate object-–mjappdelegate

3> Opening a message loop

Every time a supervisor hears the corresponding system event, it will notify Mjappdelegate

4> Create a UIWindow object (inherited from UIView) for the application, set to the Mjappdelegate window property

5> load Info.plist file, read the name of the primary storyboard file

6> load the primary storyboard file, create a white arrow that refers to the Controller object

7> and set the 6th step to create the controller for the UIWindow Rootviewcontroller property (Root Controller)

8> show UIWindow, before the show will add Rootviewcontroller view to UIWindow above (in this step will create the controller's view)

[Window AddSubview:window.rootViewControler.view];

Entering the main function, the Uiapplicationmain method is executed in the main function of MAIN.M, which is the entry point of the IOS program!

int uiapplicationmain (int argc, char argv[], nsstring principalclassname, NSString *delegateclassname)

ARGC, Argv:iso C standard main function parameters, directly passed to the Uiapplicationmain for related processing can be

Principalclassname: Specifies the application class, which must be uiapplication (or subclass). If nil, use the UIApplication class as the default value

Delegateclassname: Specifies the proxy class for the application class that must comply with the Uiapplicationdelegate protocol

This function creates a UIApplication object based on Principalclassname and creates a delegate object based on Delegateclassname. and assigns the delegate object to the delegate property in the UIApplication object

The Luiapplication object sends a different message to the delegate object in turn, and then builds the application's main Runloop (the event loop) to handle the event (the application of the delegate object is called first: Didfinishlaunchingwithoptions:)

This function returns when the program exits normally. If the process is to be forced to kill by the system, it is usually terminated before the function can return to the process.

Full boot process for iOS

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.