Steps......... /**① Child View definition protocol: @protocol *② define proxy @property (weak,nonatomic) ID in the Child view interface file <myheaderdelegate>delegate;* ③ is added in the implementation file of the child view (for example, the click Practice: [Self.delegate myheaderdidselectedheader:self];) *④ Parent View Compliance Protocol <myheaderdelegate>* ⑤ Parent View Setting Agent [header Setdelegate:self];*⑥ Parent View Execution Agent method   -(void) Myheaderdidselectedheader: (MyHeader *) header;*/@ Protocol Classnamedelegate <NSObject>    -(void) Myheaderdidselectedheader: (MyHeader *) header; @end// interface in the interface file that defines the proxy @property (weak,nonatomic) ID <myheaderdelegate>delegate;//above all the child views (for example, in the event of clicking a button) in the implementation file of the child view [ Self.delegate myheaderdidselectedheader:self];//Parent View Compliance Protocol <muheaderdelegate>//Parent View Execution Agent method    -(void) Myheaderdidselectedheader: (MyHeader *) header{    //Execute proxy method}//set proxy [header setdelegate:self];
Protocols and proxies for IOS