It takes six steps to design a proxy mode: first, it is necessary to clarify who is the principal, and who is the agent. A. The principal and the agent are not separate, so each other refers to each other's head file two, the principal party: Declare a trust agreement a. Since it is a delegate agreement, it must be declared in the class of the principal. Like a bulletin, since it is for others to know, it is naturally declared in the. h file. B. Just declare what you want to do, and don't tell the agent what to do. This means that you do not need to implement a method as long as you declare one. On the code: third, the principal party: declares a delegate agent property A. The function of the declaration is to provide an interface to the agent to get the proxy, without this statement, even if the delegation can see the delegation, also become the agent of the principal. Then, this delegate is meaningless. On the code: four, the agent: to comply with the agreement, to become the agent on behalf of the code: five, the agent: the execution of the principal way on the code: six, the principal party: Check whether the agent has to follow and implement the agreement for the first time to write Bo, the wrong place please forgive me. Hope to learn and progress together with you!
The application of IOS proxy design mode--Reverse pass value