iOS 设置代理详细步骤

//设置代理 和方法  属性
@protocol detailNoteProtocol <NSObject]]>

- (
void)aa;

@end

//声明代理属性
@property (nonatomicassign)id<detailNoteProtocol>delegate;

//制定接受代理方
if (_delegate && [_delegate respondsToSelector:@selector(aa)]) {
        [
_delegate aa];
    }



接受代理

在.h 里面 
引入头文件,   接受代理协议,  
在.m 里面
实现代理方法 ,  记着写 : _detailVC.delegate = self;



你可能感兴趣的:(iOS,delegate,代理,协议,步骤)