zoukankan      html  css  js  c++  java
  • NSNotificationCenter

      dispatch_queue_t defaultQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
        dispatch_async(defaultQueue, ^{
            [[NSNotificationCenter defaultCenter] postNotificationName:@"test" object:nil];
        });


     注意释放
     [[NSNotificationCenter defaultCenter] removeObserver:self name:@"test" object:nil];  


    UIDevice通知

    //UIDevice对象会不间断地发布一些通知,下列是UIDevice对象所发布通知的名称常量:
    UIDeviceOrientationDidChangeNotification // 设备旋转
    UIDeviceBatteryStateDidChangeNotification // 电池状态改变
    UIDeviceBatteryLevelDidChangeNotification // 电池电量改变
    UIDeviceProximityStateDidChangeNotification // 近距离传感器(比如设备贴近了使用者的脸部)
     

    键盘通知

     
    UIKeyboardWillShowNotification // 键盘即将显示
    UIKeyboardDidShowNotification // 键盘显示完毕
    UIKeyboardWillHideNotification // 键盘即将隐藏
    UIKeyboardDidHideNotification // 键盘隐藏完毕
    UIKeyboardWillChangeFrameNotification // 键盘的位置尺寸即将发生改变
    UIKeyboardDidChangeFrameNotification // 键盘的位置尺寸改变完毕
     
     

     

     
     
  • 相关阅读:
    Python正课132 —— Vue 进阶5
    Python正课131 —— Vue 进阶4
    Python正课130 —— Vue 进阶3
    logging模块
    作业20
    suprocess模块
    configparser模块
    hashlib模块
    shutil模块
    序列化模块
  • 原文地址:https://www.cnblogs.com/wcLT/p/5084227.html
Copyright © 2011-2022 走看看