标签:
Block 传值
.h
typedef void(^CountBlock)(NSIntegerfigure);
-(void)CountWithFigureBlock:(CountBlock)figureBlock;
.m
CountBlock cBlock;
#pragma mark - 块传值调用的方法
-(void)CountWithFigureBlock:(CountBlock)figureBlock
{
cBlock=figureBlock;
}
块的使用
InCashViewController *cashVC = [InCashViewControllernew];
[cashVC CountWithFigureBlock:^(NSInteger figure) {
NSString * str=[NSString stringWithFormat:@"%ld",figure];
reduceStr=str;
}];
版权声明:本文为博主原创文章,未经博主允许不得转载。
标签:
原文地址:http://blog.csdn.net/summer493506332/article/details/47259567