NSNotificationCenter的工作机制
来源:互联网 发布:ai编程算法基础 编辑:程序博客网 时间:2024/05/22 06:56
NSNotificationCenter的工作机制
1.消息的代理方法
-(void) playNotification:(NSNotification*) value
{
NSString *currentValue = (NSString*)[value object];
NSDate *currentDate = [NSDate date];
NSLog(@"当前时间%@发布消息的参数%@",currentDate,currentValue);
}
2.向消息中心参加消息
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(playNotification:) name:@“slyNotification" object:nil];
3.发布消息
[[NSNotificationCenter defaultCenter] postNotificationName:@“slyNotification" object:@"sly"]
- NSNotificationCenter的工作机制
- NSNotificationCenter消息机制
- 消息通信机制NSNotificationCenter
- 消息通信机制NSNotificationCenter
- 消息通信机制NSNotificationCenter
- 消息通信机制NSNotificationCenter
- 消息通信机制NSNotificationCenter
- 消息通信机制NSNotificationCenter
- NSNotificationCenter消息机制
- IOS 消息机制(NSNotificationCenter)
- IOS 消息机制(NSNotificationCenter)
- IOS 消息机制(NSNotificationCenter)
- IOS 消息机制(NSNotificationCenter)
- IOS 消息机制(NSNotificationCenter)
- IOS 消息机制(NSNotificationCenter)
- NSNotificationCenter --- 消息机制
- IOS 消息机制(NSNotificationCenter)
- IOS 消息机制(NSNotificationCenter)
- Run Loop
- netbeans常用快捷键
- 交叉编译CUPS
- 建造者模式lua实现
- 对手
- NSNotificationCenter的工作机制
- 矩形框绘制_运动检测_OpenCV
- 我的第一篇博客
- 条件注释判断浏览器
- Android开发笔记(各错误或知识点汇总)(转)
- 密码加密以及发邮件激活
- 小知识点
- Codeforces Round #209 (Div. 2), problem: (D) Pair of Numbers
- JavaScript动态插入script