block 页面传值

时间:2015-08-03 19:10:41   收藏:0   阅读:182

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

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!