The application of IOS proxy design mode--Reverse pass value

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.