当前位置:网站首页>Using block to realize the traditional values between two pages
Using block to realize the traditional values between two pages
2022-07-06 18:26:00 【Full stack programmer webmaster】
Hello everyone , I meet you again , I'm the king of the whole stack .
the second view Make a statement block attribute :
@property (nonatomic, copy) void(^doTransferMsg)(NSString *_msg);
Then check in the value transmission method block Does it exist
– (IBAction)transferText:(UIButton *)sender { if (_doTransferMsg) { _doTransferMsg(@”hello there”); _doTransferMsg = nil; } [self.navigationController popViewControllerAnimated:YES]; }
Lord View in . Create a second view When . Realize this by the way block
– (IBAction)LoadDetailView:(UIButton *)sender { [ibTextLabel setText:nil]; DetailViewController *_curDetail = [[DetailViewController alloc] initWithNibName:@”DetailViewController” bundle:nil]; [_curDetail setDoTransferMsg:^(NSString *_msg) { dispatch_async(dispatch_get_main_queue(), ^{ [ibTextLabel setText:_msg]; }); }]; [self.navigationController pushViewController:_curDetail animated:YES]; [_curDetail release]; }
that’s all
Copyright notice : This article is an original blog article , Blog , Without consent , Shall not be reproduced .
Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/117387.html Link to the original text :https://javaforall.cn
边栏推荐
- Excellent open source fonts for programmers
- UFIDA OA vulnerability learning - ncfindweb directory traversal vulnerability
- 从交互模型中蒸馏知识!中科大&美团提出VIRT,兼具双塔模型的效率和交互模型的性能,在文本匹配上实现性能和效率的平衡!...
- [.Net core] solution to error reporting due to too long request length
- Grafana 9.0 正式发布!堪称最强!
- Insert dial file of Jerry's watch [chapter]
- STM32按键状态机2——状态简化与增加长按功能
- Take you through ancient Rome, the meta universe bus is coming # Invisible Cities
- CSRF vulnerability analysis
- Windows连接Linux上安装的Redis
猜你喜欢
Windows connects redis installed on Linux
【Swoole系列2.1】先把Swoole跑起来
44所高校入选!分布式智能计算项目名单公示
2019 Alibaba cluster dataset Usage Summary
Recommend easy-to-use backstage management scaffolding, everyone open source
Declval of template in generic programming
递归的方式
Shangsilicon Valley JUC high concurrency programming learning notes (3) multi thread lock
使用cpolar建立一个商业网站(1)
The third season of Baidu online AI competition is coming in midsummer, looking for you who love AI!
随机推荐
287. 寻找重复数
從交互模型中蒸餾知識!中科大&美團提出VIRT,兼具雙塔模型的效率和交互模型的性能,在文本匹配上實現性能和效率的平衡!...
关于这次通信故障,我想多说几句…
C language college laboratory reservation registration system
十、进程管理
阿里云国际版ECS云服务器无法登录宝塔面板控制台
A method of sequentially loading Unity Resources
POJ 2208 已知边四面体六个长度,计算体积
面向程序员的精品开源字体
Splay
用友OA漏洞学习——NCFindWeb 目录遍历漏洞
2022暑期项目实训(三)
Blue Bridge Cup real question: one question with clear code, master three codes
第三季百度网盘AI大赛盛夏来袭,寻找热爱AI的你!
Windows连接Linux上安装的Redis
declval(指导函数返回值范例)
UFIDA OA vulnerability learning - ncfindweb directory traversal vulnerability
Docker安装Redis
atcoder它A Mountaineer
關於這次通信故障,我想多說幾句…