NSNotificationCenter通知传参数
来源:互联网 发布:免费聊天相亲软件 编辑:程序博客网 时间:2024/04/29 13:26
//发送通知 (_seletedModel表示要传递的对象参数)
[[NSNotificationCenterdefaultCenter]postNotificationName:@"categoryDidChanged"object:niluserInfo:@{@"categoryModel":_seletedModel}];
//添加观察者
[[NSNotificationCenterdefaultCenter]addObserver:selfselector:@selector(categoryChange:)name:@"categoryDidChanged"object:nil];
//CategoriyModel为自定义的模型
- (void)categoryChange:(NSNotification*)noti{
CategoriyModel *md = (CategoriyModel*)noti.userInfo[@"categoryModel"];
NSLog(@"%@",md.name);
}
0 0
- NSNotificationCenter通知传参数
- NSNotificationCenter带参数的通知
- 通知传值(NSNotificationCenter)
- 通知传值(NSNotificationCenter)
- NSNotificationCenter 通知传值
- NSNotificationCenter 传递带参数的通知
- NSNotificationCenter 传递带参数的通知
- NSNotificationCenter PostNotification传参数
- NSNotificationCenter 通知
- 通知NSNotificationCenter
- 通知--NSNotificationCenter
- 通知NSNotificationCenter
- NSNotificationCenter通知
- NSNotificationCenter 通知中心实现传值
- OC传值之-通知,NSNotificationCenter
- 使用NSNotificationCenter 事件通知
- 通知中心NSNotificationCenter
- 通过NSNotificationCenter发送通知
- wamp 安装配置
- 《C++ primer》英文第五版阅读笔记(十九)——位运算符,sizeof运算符和逗号运算符
- 传智播客javase总结 7
- oracle 10g 创建数据库实例卡在3%不动
- Python篇----面向对象程序设计(一)(类和对象篇)
- NSNotificationCenter通知传参数
- codeforce #320E Weakness and Poorness (三分)
- 用二叉树求解代数表达式
- actionbar标题功能+多个fragment切换+listview展示
- Java NIO教程(下)
- 渗透测试项目一
- java中String s="abc"及String s=new String("abc")-----------面试必备
- error MSB4018 “CL”任务意外失败
- Leetcode167: Bitwise AND of Numbers Range