iOS program startup process

Source: Internet
Author: User
Program startup process: The main function executes a uiapplicationmain this function int main (int argc, char * argv[]) {@autoreleasepool {
Return Uiapplicationmain (argc, argv, Nil, Nsstringfromclass ([Appdelegate class]));

}}intuiapplicationmain (int argc, char*argv[], NSString *principalclassname, NSString *delegateclassname) Principalclassname: Specifies the application class name (symbol of the app), which must be uiapplication (or subclass). If nil, the UIApplication class is used as the default value Delegateclassname: Specifies the proxy class for the application, This class must comply with the Uiapplicationdelegate protocol Uiapplicationmain implementation of the underlying: 1. Create a UIApplication object based on the class name provided by Principalclassname 2. Based on the Delegateclassname class name The delegate object and assigns a value to the delegate property of the UIApplication object. 3. The application:didfinishlaunchingwithoptions of the delegate object is called first after the program finishes: Method 4. Build the Mainloop event loop of the application, handle the event (constantly traversing, constantly take the event from the event queue, and each event of the app will be added to the queue) (4. Load the Info.plist file and parse it to see if the specified Main.storyboard file is loaded if specified. 5. When the program exits normally, it returns

iOS program startup process

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.