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