现在的位置: 首页 > 综合 > 正文

NSNotificationCenter 用法

2013年08月14日 ⁄ 综合 ⁄ 共 219字 ⁄ 字号 评论关闭

1. 定义一个方法

update

 

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

 

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

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

 

看贴请回帖!

抱歉!评论已关闭.