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,