IOS开发之利用通知(NSNotification)进行数据传递
来源:互联网 发布:c语言 十进制转换bcd 编辑:程序博客网 时间:2024/05/04 00:55
上篇文章介绍了通知机制及常用的设备通知使用方式,这篇文章就举个例子来实现下利用通知进行数据传递
现在有两个控制器,分别为OneViewController、TwoViewController
点击OneViewController中的button发出通知,并且TwoViewController接收通知打印OneViewController中传递过来的值
- (void)buttonClick{
}
在发送通知后,在TwoViewController控制器中注册通知监听者,将通知发送的信息接收
- (void)viewDidLoad {
}
//将会把userInfo本身作为参数传进来
- (void)send:(NSNotification *)queue {
NSLog(@"%@",queue.userInfo[@"textTwo"]);
}
//销毁时移除通知
-(void)dealloc{
[[NSNotificationCenter defaultCenter]removeObserver:self];
}
- IOS开发之利用通知(NSNotification)进行数据传递
- iOS开发-进阶:利用通知(NSNotification)进行数据传递
- iOS利用通知(NSNotification)进行传值
- iOS利用通知(NSNotification)进行传值
- iOS开发-通知NSNotification
- (7)---01 iphone 开发 数据传递 NSNotification 通知机制演示
- ios -- NSNotification(通知)
- iOS开发之NSNotification
- IOS通知机制(NSNotification)
- iOS开发NSNotification(通知)的正向传值
- iOS开发NSNotification(通知)的正向传值
- iOS经典讲解之NSNotification(通知)
- iOS通知学习笔记(NSNotification)
- iOS 消息通知-NSNotification
- ios 通知NSNotification
- iOS 通知 NSNotification
- iOS -- 通知NSNotification
- NSNotification IOS通知中心
- 【转】各大公司使用的第三方库
- error loading /system/media/audio/ui/KeypressStandard.ogg
- {A} + {B}(set容器)
- String StringBuffer StringBuilder区别
- SAT数学难题解题方法
- IOS开发之利用通知(NSNotification)进行数据传递
- TCP/IP TIME_WAIT状态原理
- iOS通过iTunes search检测版本更新,并提示用户更新!
- 6.15 喜刷刷 1 oj 1 对象数组中的最大值
- iOS文字 转 语音
- 正则表达式判断电话号码
- 向对象的的基本特征:抽象,封装,继承,多态
- LeetCode Contains Duplicate III
- [leetcode] Implement Trie (Prefix Tree)