block 页面传值
2015-08-03 17:40
204 查看
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;
}];
.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;
}];
相关文章推荐
- 多个Button的动画
- 音乐播放器
- Apache的prefork模式和worker模式
- AOP术语
- ABP(现代ASP.NET样板开发框架)系列之17、ABP应用层——参数有效性验证
- CentOS6.5双网卡绑定
- 提取手机上的联系人号码制作通讯录
- HDU 1171 Big Event in HDU(多重背包)
- hdoj-1171-Big Event in HDU【动态规划】
- 发布订阅机制
- centos swig 编译c,python调用
- 还好活下来了
- “The run destination iOS Device is not valid for running the scheme”
- 一行字符中寻找英文单词个数
- url
- java发送邮件(1)
- 匹配邮箱正则表达式
- 指纹识别的基本原理
- zoj 3612 ——Median
- 合并百度影音的离线数据 with python 2.3 格式更新