您的位置:首页 > 移动开发 > IOS开发

IOS 通知中心(个人)

2013-11-28 14:35 337 查看
使用这个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];//获取到传递的对象

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: