iOS basic----iOS run process

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.