通知中心用的不是很熟。
只知道一个简单的信息发送,信息接受。
//信息发送
[[NSNotificationCenter defaultCenter] postNotificationName:@"hehe" object:nil userInfo:@{[NSString stringWithFormat:@"%ld",count]:@"key"}];
//注册通知接收者
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(NSNotificationCenterMethod:) name:@"hehe" object:nil];
//退出的时候移除
[[NSNotificationCenter defaultCenter] removeObserver:self];
// 信息接收
- (void)NSNotificationCenterMethod :(NSNotificationCenter *)userinfo {
NSLog(@"userinfo :%@",userinfo);
}
后续再补充...