iOS开发 NSNotificationCenter 通知的使用方法
来源:互联网 发布:大数据销售 编辑:程序博客网 时间:2024/04/30 17:52
//发送通知到 (在需要的地方发送通知, 信息储存在userInfo(字典类型))
[[NSNotificationCenterdefaultCenter] postNotificationName:NSNOTIFICATION_TAGobject:self userInfo:userInfo];
//z在需要的地方接受通知
[[NSNotificationCenterdefaultCenter] addObserver:selfselector:@selector(messageNotifacation:)name:NSNOTIFICATION_TAGobject:nil];
//方法
- (void)messageNotifacation:(NSNotification*)notification {
NSDictionary *userInfo = notification.userInfo;
信息可以从userInfo中取出
}
注:"NSNOTIFICATION_TAG" 我们自定义的标识符
0 0
- iOS开发 NSNotificationCenter 通知的使用方法
- iOS开发之NSNotificationCenter(通知)的使用方法
- iOS开发之NSNotificationCenter(通知)的使用方法
- iOS开发之:NSNotificationCenter(通知)的使用方法
- IOS NSNotificationCenter 通知使用方法
- iOS开发:NSNotificationCenter,通知中心的使用
- NSNotificationCenter(通知)的使用方法
- iPhone开发之NSNotificationCenter(通知)的使用方法
- iPhone开发之NSNotificationCenter(通知)的使用方法
- iPhone开发之NSNotificationCenter(通知)的使用方法
- iPhone开发之NSNotificationCenter(通知)的使用方法
- 【转载】iPhone开发之NSNotificationCenter(通知)的使用方法
- iOS开发 - 通知中心(NSNotificationCenter)
- ios开发--注册通知NSNotificationCenter
- iOS开发 - 通知中心(NSNotificationCenter)
- iOS通知NSNotificationCenter的使用
- ios NSNotificationCenter通知的使用
- iOS 本地通知NSNotificationcenter --- iOS 开发
- 团队项目开发——TFS
- 免费的域名和空间
- Android Studio如何使用GitHub上的开源项目
- 进程通信--有名管道
- Jquery - 页面刷新滚动条自动滚到最底下
- iOS开发 NSNotificationCenter 通知的使用方法
- C语言知识点-4
- 洛谷 P1069 细胞分裂
- av_reduce
- codeforces 721C journey(动态规划+拓扑排序)
- PE文件本地DLL注入实现
- JavaSE:1min讲解引用类型参数(2)-抽象类
- Android Studio ,项目开发Bug大全
- Window 学习笔记(一)