使用这个IOS通知中心,其实和安卓的广播一样,起码我是这么觉得,都是广播吧
[[NSNotificationCenter defaultCenter] postNotificationName:@"postData" object:nil];
postData 为通知名称,object 为通知对象,以下为接收通知
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector (postset:) name:@"postData" object:nil];
-(void)postset:(NSNotification*) notification{
NSString *obj = [notification object];//获取到传递的对象
}