iOS开发 -- 通知Notification
来源:互联网 发布:手机店铺销售软件 编辑:程序博客网 时间:2024/06/04 18:04
通知使用起来非常的简单:
首先定义回调,即发生通知了我应该做啥事。
- (void)callBack{ NSLog(@"我收到通知了!");}
其次,注册通知,即告诉通知中心,我对啥通知感兴趣
[[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(callBack) name: @"A类通知" object: nil];
第三,在程序任何一个地方都可以发送通知
- (void)getNotofocation{ NSLog(@"get it."); //发出通知 [[NSNotificationCenter defaultCenter] postNotificationName:@"A类通知" object:self];}
当然,也可以在需要的时候取消注册通知。
0 0
- iOS开发 -- 通知Notification
- iOS开发-- Notification 通知与消息机制
- IOS Notification通知实例
- IOS Notification 通知中心
- IOS Notification 通知中心
- iOS 通知notification
- iOS Notification 通知中心
- iOS 通知notification
- iOS开发 ☞ 推送通知(Push Notification)
- iOS Notification – 远程通知
- Notification通知,通知中心,发布通知,通知代理对比 - iOS
- iOS开发中通知(Notification)快速入门及推送通知实现教程
- 【Android 开发教程】Notification通知
- 《notification》WEB开发桌面通知
- Android开发之Notification(通知)
- AppleWatch开发Notification通知界面开发指南
- iOS 中常用通知(Notification)
- iOS之Local Notification(本土通知)
- Android之如何强制横竖屏显示
- iis6.0 页面伪静态 URLRewriter
- 状态机按键消抖
- 阿里笔试之最长公共子串
- Xposed源码剖析——app_process作用详解
- iOS开发 -- 通知Notification
- 51NOD 1264 线段相交
- HttpURLConnection----利用接口回调和多线程进行简单的文件下载
- HBase+ZooKeeper+Hadoop2.6.0的ResourceManager HA集群高可用配置
- C++停止服务及其依赖项
- CoCreateInstance
- __Weak的用法
- 禁止横屏(竖屏显示),去掉标题
- DR图像处理技术