Uiapplicationmain
A uiapplicationmain function is executed in the main function.
int uiapplicationmain (int argc, char *argv[], nsstring *principalclassname, NSString *delegateclassname);
ARGC, argv: direct transfer to Uiapplicationmain for related processing can be
Principalclassname: Specifies the application class name (symbol of the app), which must be uiapplication (or subclass). If nil, use the UIApplication class as the default value
Delegateclassname: Specifies the application's proxy class, which must comply with the Uiapplicationdelegate protocol
The Uiapplicationmain function creates a UIApplication object based on Principalclassname and creates a delegate object from Delegateclassname. and assigns the delegate object to the delegate property in the UIApplication object
The application's main Runloop (the event loop) is then created, and the event is processed (the application:didfinishlaunchingwithoptions of the delegate object is called first after the program is completed: method)
The Uiapplicationmain function returns when the program exits normally
when the program starts, it executes the main function, which has the following actions in the main function.
int main (int argc, char * argv[]) {
@autoreleasepool {
Third parameter: UIApplication class name or subclass name nil = = @ "UIApplication"
Fourth parameter: proxy name of the uiapplication agent
Nsstringfromclass: Converting a class name to a string
Nsstringfromclass Benefits: 1. Prompt function 2. Avoid input errors
return Uiapplicationmain (argc, argv, Nil, Nsstringfromclass ([Appdelegate class]));
}
}
program Complete START process
1. Execute main
2. Execute the Uiapplicationmain function.
3. Create the UIApplication object and set the proxy for the Uiapplicationmain object.
the third parameter of UIApplication is the name of UIApplication, which defaults to uiapplication if it is specified as nil.
The fourth parameter of uiapplication is the proxy for uiapplication.
4. Turn on a main run cycle. Ensure that the application does not exit.
5. Load the info.plist. Load the configuration file. Determine if there is a info.plist file with the main storyboard filename base name
There is no specified storyboard file, if any, to load the Info.plist file, if not, then the application load is complete.
iOS program start-up process