标签:
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对象所发布通知的名称常量:UIDeviceOrientationDidChangeNotification // 设备旋转UIDeviceBatteryStateDidChangeNotification // 电池状态改变UIDeviceBatteryLevelDidChangeNotification // 电池电量改变UIDeviceProximityStateDidChangeNotification // 近距离传感器(比如设备贴近了使用者的脸部) UIKeyboardWillShowNotification // 键盘即将显示UIKeyboardDidShowNotification // 键盘显示完毕UIKeyboardWillHideNotification // 键盘即将隐藏UIKeyboardDidHideNotification // 键盘隐藏完毕UIKeyboardWillChangeFrameNotification // 键盘的位置尺寸即将发生改变UIKeyboardDidChangeFrameNotification // 键盘的位置尺寸改变完毕
标签:
原文地址:http://www.cnblogs.com/wcLT/p/5084227.html