当前位置:网站首页>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
边栏推荐
- Distill knowledge from the interaction model! China University of science and Technology & meituan proposed virt, which combines the efficiency of the two tower model and the performance of the intera
- POJ 2208 已知边四面体六个长度,计算体积
- Principle and usage of extern
- 【Swoole系列2.1】先把Swoole跑起来
- This article discusses the memory layout of objects in the JVM, as well as the principle and application of memory alignment and compression pointer
- TOP命令详解
- 關於這次通信故障,我想多說幾句…
- I want to say more about this communication failure
- CRMEB 商城系统如何助力营销?
- 阿里云国际版ECS云服务器无法登录宝塔面板控制台
猜你喜欢
關於這次通信故障,我想多說幾句…
std::true_type和std::false_type
SAP Fiori 应用索引大全工具和 SAP Fiori Tools 的使用介绍
队列的实现
Distill knowledge from the interaction model! China University of science and Technology & meituan proposed virt, which combines the efficiency of the two tower model and the performance of the intera
【中山大学】考研初试复试资料分享
Transport layer congestion control - slow start and congestion avoidance, fast retransmission, fast recovery
十、进程管理
win10系统下插入U盘有声音提示却不显示盘符
CSRF漏洞分析
随机推荐
Jerry's watch reading setting status [chapter]
Top command details
The latest financial report release + tmall 618 double top, Nike energy leads the next 50 years
IP, subnet mask, gateway, default gateway
[Android] kotlin code writing standardization document
MySQL查询请求的执行过程——底层原理
图片缩放中心
Tree-LSTM的一些理解以及DGL代码实现
J'aimerais dire quelques mots de plus sur ce problème de communication...
Transport layer congestion control - slow start and congestion avoidance, fast retransmission, fast recovery
Interesting - questions about undefined
Splay
DOM简要
使用block实现两个页面之间的传统价值观
重磅硬核 | 一文聊透对象在 JVM 中的内存布局,以及内存对齐和压缩指针的原理及应用
A method of sequentially loading Unity Resources
Maixll-Dock 摄像头使用
Distiller les connaissances du modèle interactif! L'Université de technologie de Chine & meituan propose Virt, qui a à la fois l'efficacité du modèle à deux tours et la performance du modèle interacti
Excellent open source fonts for programmers
1700C - Helping the Nature