NSNotificaiton的理解

NSNotificationCenter
	NSObject *obj1 = [NSObject new];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleNoti:) name:@"TESTNOTIFICATION" object:nil];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleNoti:) name:@"TESTNOTIFICATION" object:obj1];

我们往通知中心添加两个一样通知

(lldb) po [NSNotificationCenter defaultCenter]
<NSNotificationCenter:0x1c00c9fb0>
Name, Object, Observer, Options
com.apple.accessibility.reduce.motion.status, 0x1ad937418, 0x1033027f0, 1001
com.apple.accessibility.asst.scanner.status, 0x1ad937418, 0x1033027f0, 1001
UIAccessibilitySingleSystemColorChangedNotification, 0x1ad937418, 0x1b53a0da0, 1400
com.apple.accessibility.button.shapes, 0x1ad937418, 0x1033027f0, 1001
UIAccessibilityReduceMotionStatusDidChangeNotification, 0x1ad937418, 0x1c044efd0, 1400
com.apple.hangtracer.enabledstate, 0x1ad937418, 0x1c4458c30, 1400
UIWindowDidBecomeHiddenNotification, 0x1ad937418, 0x1c419d740, 1400
com.apple.accessibility.fontsize, 0x1ad937418, 0x1ad937558, 1001
UIStatusBarItemViewShouldEndDisablingRasterizationNotification, 0x1ad937418, 0x103820800, 1400
com.apple.accessibility.orb.sensitivity.changed, 0x1ad937418, 0x1033027f0, 1001
UIWindowDidBecomeVisibleNotification, 0x1ad937418, 0x1c419d740, 1400
com.apple.accessibility.asssistive.touch.status, 0x1ad937418, 0x1033027f0, 1001
com.apple.accessibility.reduce.white.point, 0x1ad937418, 0x1033027f0, 1001
com.apple.accessibility.wob.status, 0x1ad937418, 0x1033027f0, 1001
_UIApplicationWillAddDeactivationReasonNotification, 0x1ad937418, 0x1c40ea380, 1400
UIApplicationDidBecomeActiveNotification, 0x1ad937418, 0x1b53a0da0, 1400
com.apple.accessibility.ccoptions, 0x1ad937418, 0x1033027f0, 1001
UIContentSizeCategoryDidChangeNotification, 0x1ad937418, 0x1c044eb80, 1400
_UIApplicationForcedUserInterfaceLayoutDirectionChangedNotification, 0x1ad937418, 0x103201510, 1400
UIApplicationDidEnterBackgroundNotification, 0x1ad937418, 0x1c40ea380, 1400
UIApplicationDidEnterBackgroundNotification, 0x1ad937418, 0x1c4460e80, 1002
UIApplicationDidEnterBackgroundNotification, 0x1ad937418, 0x1c0079340, 1002
UIApplicationDidEnterBackgroundNotification, 
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值