关于通知
1.消息源
- 创建通知
NSNotification *notifiction = [NSNotification notificationWithName:@"tongzhi" object:nil userInfo:dic];
- 发出消息
[[NSNotificationCenter defaultCenter]postNotification:notifiction];
2.消息接收者
-
添加观察者
[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(tongzhi:) name:@"tongzhi" object:nil];
-
实现通知
-(void)tongzhi:(NSNotification *)notification{ }
网友评论