1. Each application has its own Uiwindow,uiwindow inherited from the Uiview2.uiview face problem: 1. Who controls the switch between UIView? 2. Who manages the UIView life cycle? 3. Who will assemble the data for UIView? 4. Who listens to UIView's events? The answers to the above three questions are: Uiviewcontroller
iOS Core class
- UIView: Views, things that can be seen and touched on the screen are UIView, such as buttons, text labels, tables
- Uiviewcontroller: Internal default has a UIView view, responsible for managing the UIView lifecycle, assembling data to uiview display, processing UIView time
- iOS design takes the MVC pattern (pattern, view, Controller)
How iOS Programs work: 1. First execute the main function 2. Perform the Uiapplicationmain function inside the 3.UIApplicationMain function internal 1. Create an UIApplication instance. This UIApplication object is a singleton, an iOS program corresponding to a UIApplication instance 2.UIApplication object is the symbol of the application 3. Turn on a message loop (main loop) 4. Create another UIA Pplication delegate object, which is responsible for monitoring the life cycle of the UIApplication 5. When the UIApplication life cycle changes, the delegate is sent a different message 4. Arguments to the UIApplication function: The 4th parameter is used to specify the UIApplication's proxy 3rd parameter to specify the class name of the UIApplication (or subclass), and if nil, the default is UIApplication Each new interface is a new UIView, and in the process of switching, it involves:
- Creation and destruction of UIView
- UIView interaction with the user (handles the click of each line within the UIView)
Uiviewcontroller
- In fact, whenever a new interface is displayed, a new Uiviewcontroller object is created first, and then a corresponding full-screen Uiview,uiviewcontroller is created to manage this UIView
- Uiviewcontroller is UIView's big housekeeper, responsible for creating, displaying, destroying uiview, monitoring the internal time of the UIView, and dealing with the interaction between the UIView and the user.
- There is a UIView attribute inside Uiviewcontroller, which is the UIView object that it manages: @property (nonatomic,retain) UIView *view;
So when we want to listen to the button, progress bar, slider, and other events, we have to hand over to the controller uiviewcontrollre to monitor
iOS basic----iOS run process