• NSNotificationCenter消息通信(KVO)


    NSNotificationCenter是程序不同类间的消息通信.

    注册消息通知:

    1    [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(mthMsg:) name:@"mthMsg" object:nil]; 

    addObserver: 注册通知

    selector: 收到通知后调用何种方法;

    name: 通知的名字(唯一标示)。

    发送消息通知:

     [[NSNotificationCenter defaultCenter] postNotificationName:@"mthMsg" object:obj];
      postNotificationName:消息的名称  
    //键盘注册通知
    1
    //键盘升起 2 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil]; 3 //键盘降下 4 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillHide:) name:UIKeyboardWillHideNotification object:nil];
  • 相关阅读:
    oracle用户和权限
    oracle中的索引
    oracle中的序列
    oracle中的视图
    oracle PL/SQL块
    oracle创建表案列
    半导体随机存储器
    IEEE754标准
    定点数的移位操作
    真值,原码,反码以及补码和移码总结
  • 原文地址:https://www.cnblogs.com/wangshengl9263/p/3472781.html
Copyright © 2020-2023  润新知