当前位置:网站首页>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
边栏推荐
- Cobra 快速入门 - 专为命令行程序而生
- Coco2017 dataset usage (brief introduction)
- UDP协议:因性善而简单,难免碰到“城会玩”
- Introduction to the usage of model view delegate principal-agent mechanism in QT
- Docker安装Redis
- Introduction and case analysis of Prophet model
- 图之广度优先遍历
- Codeforces Round #803 (Div. 2)
- Kill -9 system call used by PID to kill process
- Principle and usage of extern
猜你喜欢
[the 300th weekly match of leetcode]
Implementation of queue
虚拟机VirtualBox和Vagrant安装
第三季百度网盘AI大赛盛夏来袭,寻找热爱AI的你!
Top command details
面向程序员的精品开源字体
FMT open source self driving instrument | FMT middleware: a high real-time distributed log module Mlog
Maixll-Dock 摄像头使用
【.NET CORE】 请求长度过长报错解决方案
Alibaba cloud international ECS cannot log in to the pagoda panel console
随机推荐
Will openeuler last long
Shangsilicon Valley JUC high concurrency programming learning notes (3) multi thread lock
STM32+MFRC522完成IC卡号读取、密码修改、数据读写
Compilation Principle -- C language implementation of prediction table
Splay
Four processes of program operation
UDP protocol: simple because of good nature, it is inevitable to encounter "city can play"
關於這次通信故障,我想多說幾句…
UFIDA OA vulnerability learning - ncfindweb directory traversal vulnerability
C language exchanges two numbers through pointers
Introduction to the usage of model view delegate principal-agent mechanism in QT
bonecp使用数据源
DOM Brief
阿里云国际版ECS云服务器无法登录宝塔面板控制台
The latest financial report release + tmall 618 double top, Nike energy leads the next 50 years
从交互模型中蒸馏知识!中科大&美团提出VIRT,兼具双塔模型的效率和交互模型的性能,在文本匹配上实现性能和效率的平衡!...
Insert dial file of Jerry's watch [chapter]
287. 寻找重复数
Self-supervised Heterogeneous Graph Neural Network with Co-contrastive Learning 论文阅读
【剑指 Offer】 60. n个骰子的点数