To use the proxy amount step:
1. Find out who is Who's agent first (delegate)
2. Define proxy protocols, naming conventions for protocol names: control class name + Delegate
3. Defining Proxy methods
A. Proxy methods are generally defined as @optional
B. Proxy method names begin with the control name
C. The proxy method has at least 1 parameters, passing the control itself out
4. Set proxy (delegate) object (e.g. myview.delegate = xxxx;)
A. Proxy Object Compliance Agreement
B. Proxy object implementation of the Protocol in the implementation of the method
5. Invoke the Proxy method at the right time for the proxy object (delegate) to notify the agent what has happened
(Determines whether the agent implements the proxy method before calling)
Introduction to Notifications:
1. A complete notification contains 3 attributes
-(NSString *) name; ————— Notification Name
-(ID) objec; —————————— Notification publisher
-(Nsdictionary *) UserInfo; ——— some additional information
2. How to initialize a notification (nsnotification) object
+ (Instancetype) Notificationwithname: (NSString *) AName object: (ID) anobject;
+ (Instancetype) Notificationwithname: (NSString *) AName object: (ID) anobject userInfo: (nsdictionary *) Auserinfo;
-(Instancetype) Initwithname: (NSString *) Name object: (ID) object userInfo: (Nddictionary *) UserInfo;
Introduction to steps and notifications for using proxies in iOS