NSNotificationCenter以及app的几种运行状态
来源:互联网 发布:mac 如何编写html 编辑:程序博客网 时间:2024/06/05 20:02
1~NSNotificationCenter(必须先注册,再发送)
注册通知:即要在什么地方接受消息
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(mytest:) name:@" mytest" object:nil];
[[NSNotificationCenter defaultCenter] postNotificationName:@"mytest" object:searchFriendArray];
object:传递的参数
- (void) mytest:(NSNotification*) notification
{
id obj = [notification object];//获取到传递的对象
}
2~移除某个通知
[[NSNotificationCenterdefaultCenter]removeObserver:selfname:UIKeyboardWillShowNotificationobject:nil];
[[NSNotificationCenterdefaultCenter]addObserver:self selector:@selector(cleanDisk) name:UIApplicationWillTerminateNotification object:nil];//APP运行结束
[[NSNotificationCenterdefaultCenter]addObserver:self selector:@selector(backgroundCleanDisk) name:UIApplicationDidEnterBackgroundNotification
object:nil];//退到后台
- NSNotificationCenter以及app的几种运行状态
- ios上的app运行状态的几种理解
- NSNotificationCenter的几种基础用法
- Activity的生命周期以及几种状态
- 如何禁止App在后台运行以及如何保存和恢复App的状态
- 如何禁止App在后台运行以及如何保存和恢复App的状态
- 如何禁止App在后台运行以及如何保存和恢复App的状态
- ios app在itunesConnect里面的几种状态
- App应用上传到appStore的几种状态
- Android通过包名或类名启动APP或者一个Activity 以及 判断APP的运行状态
- http协议以及几种常见的状态码
- android app程序运行状态的判定
- android app程序运行状态的判定
- IOS学习笔记43--IOS App在ItunesConnect里面的几种状态
- iOS app在itunesConnect里面的几种状态之解析
- iOS开发-app在itunesConnect里面的几种状态
- 几种判断应用(Android App)前后台状态的方法
- ios程序运行的几种状态 Application States and Transitions
- 各知识点1
- 建造者模式的设计
- windows - 进程 - 进程环境变量
- eclipse3.4 插件安装
- 远程连接mysql出现错误不允许当前IP访问
- NSNotificationCenter以及app的几种运行状态
- 谁说Vim不是IDE?(三)
- MemCached_wiki
- js判断鼠标移动方向
- ARRAYSIZE宏与RtlpNumberOf的区别
- QTP获取动态表格内容
- mybatis数据批量插入
- 网络基本功(十七):细说tcpdump的妙用(上)
- CAAnimation动画/CAAnimation Group