Procotol protocol iOS Development Common technology
An agreement is a set of criteria (a set of method declarations) generally only. h files
No parent class can also define instance variables, declare methods only, declare interfaces of unknown classes, and communicate @required between two classes: must be implemented. Default
@optional: Selective implementation
NSObject is a basic class root class is also a base protocol, can write or do not write
Delegate: Agent
Proxy design Pattern: Two objects work together to solve the problem, for communication between objects
Typically used for communication between control and Controller objects, control events occur through the controller behavior
This means that the object class has a delegate method, the implementation of the delegate method (adhering to the delegation protocol) needs to be implemented in other classes, and other class objects to resolve the
The creation process of the Protocol agent (3):
' A. Declaration agreement
B. Setting up an agent that obeys a protocol
C. Setup method (the method that triggers the agent execution protocol)
The use process of the Protocol Agent (outer 3):
A. Setting up an agent
B. Compliance Agreement
C. Methods in implementing the Protocol
OC Learning-Protocol Delegate