How iOS Programs work:
The 1> main.m main function is the entry function for all programs.
2> is the Uiapplicationmain function in the main function, which opens an infinite loop to listen to the application.
The Uiapplicationmain function has 4 parameters, the first two are the parameters of the main function, the class name of the 3rd parameter uiapplication, and the 4th is the proxy class name of the application.
2.1> creates an UIApplication instance, one for each application, and one for the entire application.
2.2> creates a UIApplication delegate object, which is the proxy object.
The 3> Appdelegate class is the proxy class for the entire application, which implements the Uiappliactiondelegate protocol, which has several methods for listening to applications.
(delegate events that can be handled include: Application lifecycle events (such as application opening and closing), system events (such as incoming calls), memory warnings, etc.).
Application life cycle method of Appdlegate class and its role
Qf--ios Program Operation principle