首页 > 移动平台 > 详细

iOS 之 通知

时间:2015-12-20 17:07:38      阅读:148      评论:0      收藏:0      [点我收藏+]

步骤一,注册消息:

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(getUserProfileSuccess:) name:@"Notification_GetUserProfileSuccess" object:nil];

notificationObserver 观察者 : self
notificationSelector 处理消息的方法名: getUserProfileSuccess 
notificationName 消息通知的名字: Notification_GetUserProfileSuccess
notificationSender 消息发送者 : 表示接收哪个发送者的通知,如果第四个参数为nil,接收所有发送者的通知

步骤二,发送消息

[[NSNotificationCenter defaultCenter] postNotificationName:@"Notification_GetUserProfileSuccess" object:userProfile userInfo:nil];

 

iOS 之 通知

原文:http://www.cnblogs.com/SimonGao/p/5061063.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!