码迷,mamicode.com
首页 >  
搜索关键字:nsnotificationcenter    ( 284个结果
JPush使用时问题注意
1集成JPush后,能收到通知,但是收不到自定义消息。解决方案:AppDelegate中加入如下代码://JPush推送 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(networkDidRece....
分类:其他好文   时间:2015-02-11 20:30:55    阅读次数:4323
通知&代理
通知:多对多的关系,比较耗性能使用:1.观察者到通知中心注册(接受那个发布者发布的什么通知,监听到通知后的处理方法)[[NSNotificationCenter defaultCenter] addObserver:selfselector:@selector(keyBoardShow:) name...
分类:其他好文   时间:2015-02-07 11:42:36    阅读次数:148
根据屏幕转向方向和屏幕宽度变化改变UITableView显示效果 屏幕旋转
获取屏幕转向和根据转向方向设置宽度;1、获取屏幕转向事件:[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(rotateScreen) name:UIDeviceOrientationDidChange...
分类:其他好文   时间:2015-01-23 13:04:23    阅读次数:177
UIScrollview 键盘遮挡问题
#pragma mark - UIKeyboard Obscure Problem - (void)handleKeyboardStuff { [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNo...
分类:其他好文   时间:2015-01-22 20:22:32    阅读次数:146
iOS NSNotificationCenter 使用姿势详解
最近在做平板的过程中,发现了一些很不规范的代码。偶然修复支付bug的时候,看到其他项目代码,使用通知的地方没有移除,我以为我这个模块的支付闪退是因为他通知没有移除的缘故。而在debug和看了具体的代码的时候才发现和这里没有关系。在我印象中,曾经因为没有移除通知而遇到闪退的问题。所以让我很意外,于是写...
分类:移动开发   时间:2015-01-20 17:16:22    阅读次数:400
11.ios之通知机制
通知中心(NSNotificationCenter) ?每一个应用程序都有一个通知中心(NSNotificationCenter)实例,专门负责协助不同对象之间的消息通信 ?任何一个对象都可以向通知中心发布通知(NSNotification),描述自己在做什么。其他感兴趣的对象(Observer)可以申请在某个特定通知发布时(或在某个特定的对象发布通知时)收到这个通知...
分类:移动开发   时间:2015-01-18 17:15:00    阅读次数:1497
通知中心与本地通知
发送通知[[NSNotificationCenter defaultCenter]postNotificationName:@"change" object:nil];注册通知[[NSNotificationCenter defaultCenter]addObserver:self selecto....
分类:其他好文   时间:2015-01-15 17:47:42    阅读次数:145
swift 弹出键盘view自动上升
一、设置监听键盘事件函数:override func viewWillAppear(animated: Bool) { NSNotificationCenter.defaultCenter().addObserver(self, selector: "keyboardWillShow:...
分类:编程语言   时间:2015-01-15 09:19:04    阅读次数:361
iOS 切换键盘
1.点击toolbar的加号按钮切换键盘 切换前 切换后 2 要实现上述效果2.1 需要监听键盘的弹出\隐藏 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector...
分类:移动开发   时间:2015-01-14 06:19:06    阅读次数:232
iOS 关于NSNotificationCenter
通常我们在iOS中发生什么事件时该做什么是由Delegate实现的, Apple 还为我们提供了另一种通知响应方式,那就是NSNotification.NSNotificationCenter较之于Delegate可以实现更大的跨度的通信机制,可以为两个无引用关系的两个对象进行通信。NSNotifi...
分类:移动开发   时间:2015-01-13 21:18:01    阅读次数:191
284条   上一页 1 ... 20 21 22 23 24 ... 29 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!