火星人驾到

NSNotificationCenter 用法

1. 定义一个方法

update

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

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

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

posted on 2011-04-06 16:05  火星人驾到  阅读(210)  评论(0编辑  收藏  举报