NSNotificationCenter简单使用

来源:互联网 发布:手机海外电视直播软件 编辑:程序博客网 时间:2024/05/19 06:37

1,添加监听 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(action:) name:@"A" object:nil];

2,发送通知,[[NSNotificationCenter defaultCenter] postNotificationName:@"A" object:nil];

3,执行方法
- (void)action:(NSNotification *)notification
}
}

0 0