1. Difference between shallow copy and deep copy?
1> Shallow copy: pointer (address) Copy, does not produce new objects
2> deep Copy: A copy of the content that produces a new object
2. What is advantage of categories? What is difference between implementing a category and inheritance?
There are 3 main types of categories:
(1) Scatter the implementation of a class into multiple different pieces or multiple different frameworks.
(2) Create a forward lead to private law?
(3) Add A formal agreement to an object.
1> classification can be based on the original class model without modification of the extension method
The 2> classification can only extend methods, cannot enrich member variables, and inheritance can extend methods and member variables.
will produce new classes.
3. Difference between categories and extensions??
The 1> category is named, and the class extension does not have a name
2> classification can only extend the method, cannot expand the member variable, the class extension may extend the method and the member variable
3> class extensions are generally written in . M files, which are used to augment private methods and member variables (attributes)
Note: Both inheritance and class extensions can extend methods and member variables, but inheritance produces new classes, but class extensions do not produce new classes.
4. Difference between protocol in Objective C and interfaces in Java??
The methods declared in the 1> Java interface must all be implemented
The method declared in the protocol of 2> OC is not necessarily implemented
Note:protocol is simply a list of methods that can declare many methods that can be implemented by any class, called proxy mode.
5. What is mutable and immutable types in Objective C??
1> mutable is a mutable type, such as Nsmutablearray, which dynamically adds elements to it.
2> immutable are immutable types, such as nsarray, fixed storage space, cannot add elements
6. When do we call Objective C are runtime language what does it mean??
1> Dynamic Binding: Object types are really determined at run time
2> polymorphism
3> message mechanism
7. What is push notification??
1> local push: Pop-up notifications inside the program to the user device
2> remote push: Push notifications to user devices by push server
8. What is polymorphism? ?
Polymorphic: Parent class pointer to child class object
9. What is responder chain??
? Responder chain:
L Uiresponder has a nextresponder property that can be used to form a responder chain, where an event or message is passed on its path
L if Uiresponder does not handle the event passed to it, it forwards the unhandled message to its own nextresponder
Ten. Difference between frame and bounds??
1> frame with the upper-left corner of the parent control as the Origin of the coordinates
2> bounds with the upper left corner of the control itself as the origin of the coordinates
Difference between method and selector??
Selector is the name of a method in which a method address can be found by a selector , and a method is called, which is a combination that contains the name and implementation .
There any garbage collection mechanism in Objective C.??
1> OC 1.0 no garbage collection
2> OC 2.0 is garbage collected and can only be used on Mac
3> IOS has an ARC mechanism, which is compiler feature, garbage collection is a runtime feature
What is nsoperation queue??
1> the queue used to hold nsoperation objects, which can be used to perform some operations asynchronously
2> can typically be used in time-consuming operations such as network requests
What is lazy loading??
Lazy loading: For example, the viewof the controller, the loadview method is called when the view isfirst used to create
Can we use the TableView controllers on one viewcontroller?
It is no problem to add 2 table controllers inside a controller, plus judge the condition to determine which tableview.
Can we use one tableview with different datasources? How you'll achieve this???
Parsing from object properties,TableView has only one dataSource property. Of course, it is also possible to use 2 different data sources.
iOS pen question 02