1. Is the interval period of the timer accurate? Why? How to achieve a precise timer?
The Nstimer can be accurate to 50-100 milliseconds.
The Nstimer is not absolutely accurate, and the intermediate time-consuming or blocking misses the next point, then the next point passes
2. The MVC design pattern considers three kinds of objects: Model objects, view objects, and controller objects.
Model objects represent special knowledge and expertise that are responsible for preserving the data of the application and the logic that defines the operational data.
The View object knows how to display the model data for the application and may allow the user to edit it.
The Controller object is the coordinator between the application's view object and the Model object.
3, #import跟 the difference of # include, @class?
@class is commonly used in header files where you need to declare an instance variable of the class, or you need to use #import in the M file.
The advantage of #import is that it does not cause cross-compilation.
4. Understanding of the MVC pattern
The MVC design pattern considers three types of objects: Model objects, view objects, and controller objects.
Model objects represent special knowledge and expertise that are responsible for preserving the data of the application and the logic that defines the operational data.
The View object knows how to display the model data for the application and may allow the user to edit it.
The Controller object is the coordinator between the application's view object and the Model object.
5. What are the differences and connections between threads and processes?
Processes and threads are the basic units that the operating system realizes, and the system uses this basic unit to realize the concurrency of the system to the application.
The main difference between processes and threads is that they are different ways to manage operating system resources.
The process has a separate address space, and after a process crashes, it does not affect other processes in protected mode, and the thread is just a different execution path in a process.
Threads have their own stacks and local variables, but there is no separate address space between threads, and a thread that dies is tantamount to the entire process dying out.
So multi-process program is more robust than multi-threaded programs, but in the process of switching, the cost of large resources, the efficiency is worse.
But for some concurrent operations that require simultaneous and shared variables, only threads can be used, and processes cannot be used.
6, iOS multi-line Chengchang meet questions in the project when choose to use GCD, when to choose Nsoperation? The advantage of using nsoperation in a project is that Nsoperation is a high abstraction of the thread, using it in the project, will make the program structure of the project better, the sub-class nsoperation design idea, is has the object-oriented advantage (multiplexing, encapsulation), so that the implementation is multi-threaded support, The interface is simple and recommended for use in complex projects. The advantage of using GCD in a project is that the GCD itself is very simple and easy to use, saving code for uncomplicated multithreaded operations, and the use of block parameters is more readable and recommended for simple projects. 7. Block common face question 1 What are the advantages of using block and using delegate to complete the delegation mode? Using block to implement the delegate mode, the advantage is that the callback block code block is defined within the delegate object function, so that the code is more compact, the adaptation of the object no longer need to implement a specific protocol, the code is more concise. 8. What is KVO and KVC?
Answer: KVC: Key-value encoding is a mechanism that indirectly accesses an object's properties by using a string to identify the property, rather than by invoking an access method, either directly or through an instance variable.
In many cases, the program code can be simplified. The Apple documentation actually gives a good example.
KVO: A key-value observation mechanism that provides a way to observe a change in a property, greatly simplifying the code.
9. When do we call Objective C are runtime language what does it mean?
What do we mean by the Dynamic runtime language of OC?
Answer: polymorphic. The main is to postpone the determination of the data type by compile time to the runtime.
This problem actually involves two concepts, runtime and polymorphism.
Simply put, the run-time mechanism allows us to determine the class of an object until run time, and to invoke the class object to specify the method.
Polymorphism: The ability of different objects to respond to the same message in their own way is called polymorphism. It means that a biological class (life) is-eat in the same way;
The human beings belong to the creatures, and the pigs belong to the creatures, and all inherit the life and realize their eat, but the call is the only way we call the Eat method.
That is, different objects respond to the same message in their own way (in response to the Eat selector).
So it can also be said that the runtime mechanism is the basis of polymorphism? ~~~
10, polymorphism?
About polymorphism
Answer: polymorphic, the parent pointer points to the subclass object.
This topic can actually be found in all object-oriented languages,
Therefore, on polymorphism, inheritance and encapsulation of the basic best have a sense of self-awareness, it is not necessary to write the information on the book can be memorized.
The most important thing is to translate into self-understanding.
11. What is responder chain?
Talk about the response chain
Answer: The incident response chain. Includes click events, screen refresh events, and more. Propagates from top to bottom or from bottom to top of the view stack.
It can be said that the distribution, delivery and processing of the incident. Specifically, you can look at the touch event this piece. Because the question is too abstract.
Serious doubts about the problem, the more the later the more general.
Can be from the chain of responsibility model, in terms of the incident response chain processing, its own extensibility
12, difference between frame and bounds?
What is the difference between frame and bounds?
Answer: Frame refers to the position and size of the view in the parent view coordinate system. (The reference point is the father's coordinate system)
Bounds refers to the position and size of the view in its own coordinate system. (The reference point is its own coordinate system)
13. What is the difference between the data types of common object-c and the basic data types of C? such as: Nsinteger and int
OBJECT-C data types have nsstring,nsnumber,nsarray,nsmutablearray,nsdata and so on, these are class, after creation is the object, and C language basic data type int, just a certain byte of memory space, Used to store numeric values; Nsinteger is the basic data type, not a subclass of NSNumber, and certainly not a subclass of NSObject. Nsinteger is the alias of the base data type int or long (Nsinteger's definition typedef long Nsinteger), the difference is that Nsinteger determines whether it is an int or a long based on whether the system is 32-bit or 64-bit.
Summary of verbal and moral knowledge points