美文网首页
iOS 通知的简单使用

iOS 通知的简单使用

作者: solayu | 来源:发表于2019-10-11 10:27 被阅读0次

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
{
 
}

相关文章

网友评论

      本文标题:iOS 通知的简单使用

      本文链接:https://www.haomeiwen.com/subject/oactmctx.html