当前位置:网站首页>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
边栏推荐
猜你喜欢

從交互模型中蒸餾知識!中科大&美團提出VIRT,兼具雙塔模型的效率和交互模型的性能,在文本匹配上實現性能和效率的平衡!...

STM32按键状态机2——状态简化与增加长按功能

Declval of template in generic programming
![[Android] kotlin code writing standardization document](/img/d5/53d6a75e87af15799bf7e5d6eb92a5.png)
[Android] kotlin code writing standardization document

Easy to use PDF to SVG program

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
![Jerry's updated equipment resource document [chapter]](/img/6c/17bd69b34c7b1bae32604977f6bc48.jpg)
Jerry's updated equipment resource document [chapter]
![[.Net core] solution to error reporting due to too long request length](/img/62/6bdc43885f9be3fa4538276c0dc122.png)
[.Net core] solution to error reporting due to too long request length

2019 Alibaba cluster dataset Usage Summary

Virtual machine VirtualBox and vagrant installation
随机推荐
C language exchanges two numbers through pointers
CSRF漏洞分析
Will openeuler last long
Windows connects redis installed on Linux
【中山大学】考研初试复试资料分享
重磅硬核 | 一文聊透对象在 JVM 中的内存布局,以及内存对齐和压缩指针的原理及应用
徐翔妻子应莹回应“股评”:自己写的!
Insert dial file of Jerry's watch [chapter]
atcoder它A Mountaineer
Implementation of queue
Declval (example of return value of guidance function)
测试1234
Celery best practices
DOM Brief
win10系统下插入U盘有声音提示却不显示盘符
从交互模型中蒸馏知识!中科大&美团提出VIRT,兼具双塔模型的效率和交互模型的性能,在文本匹配上实现性能和效率的平衡!...
Comparative examples of C language pointers *p++, * (p++), * ++p, * (++p), (*p) + +, +(*p)
Jerry's access to additional information on the dial [article]
Grafana 9.0 正式发布!堪称最强!
Excellent open source fonts for programmers