iOS 通知的简单使用

2019-10-11  本文已影响0人  solayu

1.注册通知+发送通知

  NSNotification *LoseResponse = [NSNotification notificationWithName:@"ChangeChannel" object:nil];
            [[NSNotificationCenter defaultCenter] postNotification:LoseResponse];

2.接受通知

    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeChannelNoti:) name:@"ChangeChannel" object:nil];

3.实现方法

- (void)ChangeChannel:(NSNotification *)noti
{
 
}
上一篇 下一篇

猜你喜欢

热点阅读