NSNotificationCenter 用法


1. 定义一个方法

update

2. [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(update) name:@"update" object:nil]

3. 在要发出通知消息的地方

[[NSNotificationCenter defaultCenter] postNotificationName:@"update" object:nil];

come from http://blog.csdn.net/dadalan/archive/2009/06/08/4252484.aspx 

原文地址:https://www.cnblogs.com/likwo/p/1808459.html