OC Learning-Protocol Delegate

Source: Internet
Author: User

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

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.