<span style="font-family: Arial, Helvetica, sans-serif;">1.注册NotificationCenter</span>
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(notificationPosedAction:) name:@"notificationPosed" object:nil];
2.NotificationCenter事件
-(void)notificationPosedAction:(NSNotification *)notif{
NSString * state = [notif object];
NSLog(@"%@",state);
}
3.触发事件
NSString * s = @"hehe";
[[NSNotificationCenter defaultCenter] postNotificationName:@......
阅读全文