First, I summarize the structure of the application myself
The first is Uiapplicationmain, this represents the application, and a program is only one.
It feels like the QT I've done before. There is a main function as the entry for the entire application, and Android does not have a function as the entry for the entire program. As to why this is so, I understand that this is the residue of C language.
iOS creates a uiapplicationmain in the main function and returns the return value of the Uiapplicationmain function.
So what's in Uiapplicationmain? I see that there is an argument for the parameter is Appdelegate, which is a managed class, which I understand to pass this parameter, we have the entire application managed to the system.
The application starts, displays, hangs, and exits, all of which are judged by the system and executed by the appropriate managed function.
Managed classes manage the life cycle of the entire application, and we can define what the application does in the corresponding function.
There is a property in the header file of the managed class, which is UIWindow, and an application has only one uiwindow. Then an interface inside iOS is a scene.
Here, I don't understand why iOS does this, a uiappcationmain corresponds to a appdelegate, a appdelegate corresponds to a uiwindow, and then a uiwindow corresponds to multiple scenes.
The hierarchy is complex.
But Android has only one application, and the presence is very low, because the system will automatically create this class, unless you want to use it to do something, such as implementing application-level global variables and so on, we will inherit it, so there is generally only one level, is the activity, An activity corresponds to an interface, and an application can have multiple activity.
An activity in a function corresponds to a scene, but the activity also contains certain UIWindow and managed functions. As far as I can feel, this flat level design is more reasonable.
But then again, iOS and Android have only two parts of the life cycle, one is application itself, and the other is the life cycle of each interface.
It's probably just so much.
Speaking English is really too important, when the best information is English, the English is too poor really the impact of efficiency AH.
iOS Development Primer Summary