1:mvc's understanding
The MVC design pattern considers three types of objects: Data Model objects, view objects, and controller objects.
Data Model: Responsible for storing, defining and manipulating data;
View: Display the data to the user, and the user to interact with the operation;
Controller: The coordinator of M and V, controls the acquisition of data and gives the data to the view to display.
2: Threads and processes
Process is a program with a certain independent function on a data set on a running activity, is the system of resource allocation and scheduling of an independent unit;
A thread is an entity of a process, a basic unit of CPU dispatch and dispatch, a unit of independent operation that is smaller than a process, which basically does not have system resources and has only a few essential resources (such as program counters, a set of registers and stacks) that are essential to the operation. One thread creates and revokes another thread.
The relationship between threads and processes:
A thread can belong to only one process, while a process may have multiple threads, but at least one thread;
A resource is assigned to a process, and multiple threads in the unified process can share threads in the process;
During the execution of the thread, the collaboration synchronization is implemented. The threads of different processes should use the method of message communication to realize synchronization;
A thread is actually running on the processing machine;
A thread is an executable unit within a process and is also a scheduled entity within a process.
The difference between threads and processes:
Dispatch: The thread acts as the basic unit of dispatch and allocation, and the process as the unit of resources;
Concurrency: Not only can the process be executed concurrently, but also can be executed concurrently between multiple threads of the same process;
Owning resources: A process is a basic unit of resources, and threads do not own system resources, but can access resources that belong to the process;
System overhead: The overhead of creating or revoking a process is large. (Because the system allocates or revokes system resources during this process)
3: Synchronization mechanism of the process
Atomic operations, semaphore mechanisms, spin locks, distributed systems, etc.
4: Cause of the process deadlock
The competition of resources and the illegal sequence of procedure promotion
5: Four necessary conditions of the deadlock
Mutex, request hold, non-deprivation, loop
6: The processing strategy of the deadlock
Ostrich strategy, prevention strategy, detection and contact deadlock
7:KVC, KVO
KVC, key-value coding, is a kind of indirect access to instance variables, the mechanism can access the object's instance variables without the access method (get setter);
KVO, the key value observation, is a kind of notice mechanism which can make the object get the change of other objects.
To implement the KVO key-value observation mode, the observed object must use the KVC key-value encoding mechanism to modify its instance variables to be observed by the observer. Therefore, KVC is the foundation of KVO, or KVO's realization is based on KVC.
8: Deep copy and shallow copy
Deep copy: Not only copy the object itself, but also copy the properties held by the object;
Shallow copy: Only the object itself is copied, not its properties.
9: When defining attributes, when to use assign, retain, copy, nonatomic?
Assign: general assignment, generally used for basic data types, common design mode, so as to prevent circular reference;
Retain: Holds the count and obtains ownership of the object. The reference count is based on the original +1;
Copy: Typically use copy in a string. Immutable objects in foundation use the copy effect equivalent to retain, but reference count +1;
Nonatomic: Non-atomic access, non-synchronous, multi-threaded concurrent access improves performance.
The difference between 10:strong and weak,_unsafe_unretained and weak.
Strong is a strong reference, weak is a weak reference, in arc, strong equivalent to retain,weak equivalent to assign, it is important to note that even in the arc case, the agent's properties are still used assign to prevent circular references;
_unsafe_unretained is consistent with the weak function, except that when the object of ambition is destroyed, the weak pointer becomes nil, preventing the wild pointer from appearing.
Is there a memory leak in 11:arc?
Circular references can lead to memory leaks, and when object-c is bridged with corecoundation it can also cause memory leaks if improperly managed.
12: Event Responder Chain
The responder chain represents a series of responder objects. The event is handed over to the first responder, and if the first responder is not processed, the event is passed up along the responder chain to the next responder (next responder),
view-viewcontroller-window-application-Discard Events
The use of 13:svn or Git
14: Packaging a static library
15:app release of the listing process
Use of 16:storyboard
Intermediate iOS Development questions