NSNotificationCenter
2016-05-19 09:32
288 查看
@interface NSNotificationCenter : NSObject
+ (NSNotificationCenter *)defaultCenter;
//发出通知 //[NSNotificationCenter defaultCenter]调用 //aName:通知的名字 //aUserInfo:将参数以字典形式封装 - (void)postNotificationName:(NSString *)aName object:(nullable id)anObject userInfo:(nullable NSDictionary *)aUserInfo; //收到通知 //[NSNotificationCenter defaultCenter]调用 //aName:通知的名字 //aSelector收到通知之后的动作 - (void)addObserver:(id)observer selector:(SEL)aSelector name:(nullable NSString *)aName object:(nullable id)anObject; //notification.userInfo里面有参数 - (void)aSelector(NSNotification *)notification { //@property (nullable, readonly, copy) NSDictionary *userInfo; }
移除通知(必须移除参数)
//[NSNotificationCenter defaultCenter]调用 - (void)removeObserver:(id)observer;
相关文章推荐
- 理解SSL必须要理解的密码技术
- QT中对话框的show()和exec()的区别
- 在FreeBSD上安装Bugzilla
- C++第六次作业--数组合并、字符串操作
- Struts2中Action动态访问调用
- linux命令--定时删除linux下面的某目录下的日志文件
- 人工智能基础01--绪论
- ImportError: No module named 'xxx'的另外一种原因
- c++实验六 项目3
- 减小Delphi XE5编译出来的程序体积
- JavaScript:Array类型全面解析
- oracle数据库怎么新建实例
- Android WebView 与JS的数据交互
- Windows远程调试Linux上的C++程序:Eclipse+MingW+Samba+GDBserver
- Oracle XDB 组件 重建 说明
- 不需要任何权限获得Android设备的唯一ID,权限android设备id
- 控制台程序的参数解析类库 CommandLine
- 浅谈色彩学:对比色配色
- js学习(20160519)
- 第十一周上机实践项目 项目2-储存班长的学生信息类(1)