1.定义block (没有返回值的block)
typedef void(^callBackBlock) (NSString *text);
2.定义block 属性
@property(nonatomic,copy)CallBackBlcok callBcakBlock;
3.给block 属性赋值
self.callBcakBlock(@"block也不是特别难");
4.调用block
controller.callBcakBlock = ^(NSString *text) {
NSLog(@"我要的结果%@========",text);
};
网友评论