iOS face Test 2

Source: Internet
Author: User


iOS face Test 2






1, Runloop is what.



A runloop is a cycle of time processing, which is used to continuously dispatch work and to process input time.
The purpose of using Runloop is to keep your threads busy working while they are working, and to be dormant when they are not working. The Runloop is designed to reduce the idle CPU idling.





2, the range type of four kinds of instance variables in iOS @private @protected @public @package






@private (Private)



An instance variable can only be accessed by the class that declares it






@protected (Protected)



Instance variables can be accessed by the classes and subclasses that declare them, and all instance variables without an explicit scope are @protected






@public (public)



Instance variables can be accessed anywhere






@package (at the framework level)



Scopes are between private and public and can be accessed directly from the variable name as long as they are in the same frame.






3, talk about the understanding of the response chain.
When an event occurs, the response chain is first sent to the first responder (often the view that the event occurred, where the user touches the screen).
Events are passed along the responder chain until they are accepted and processed.
In general, the first response is a view object or its subclass, and when it is touched, the event is handled by it, and if he does not, the time is passed to the View Controller object Uiviewcontroller (if present), then its parent view object (Superview), And so on to know the top-level view.
Next, follow the top view to the window (UIWindow object)
To the program (UIApplication object), and if the entire process does not respond to the event, the event is discarded.



In general, events are passed in the response chain whenever an object handles an event.

A typical response roadmap is as follows:
Responser--> the Window-->the applicationn--> App Delegate






4, #import, #include and @class What is the difference.

A header file is introduced #include C, but there may be a cross compilation
#importNo cross compilation


#import Introduce header files you created in OC #import ""

or the system framework #import<>.

@class declare a class, tell the compiler there is this class, but the definition of a class doesn't know anything.






5, What is lazy loading? What is lazy to load.
Initialized when used, such as the UITableViewCell ImageView attribute, the lazy load object creation is created in the setter method.












Copyright statement: This article by http://www.bestnathan.com/Original, Welcome to reprint share. Please respect the work of the author, reprinted when the statement and the author blog link, thank you


Related Article

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.