[转]不同控制器之间通信的一个好方法
首页在view1的控制器初始化init方法里加上观察者模式方法:
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(reloadChat:)
name:@”reloadChat” object:nil];
-(void)reloadChat:(id)sender{}
在view2里的button添加用来触发view1的reloadChat方法:
[[NSNotificationCenter defaultCenter] postNotificationName:@”reloadChat” object:self];
—END—
原文: http://sue602.blog.163.com/blog/static/314953072010102423136387/