A notification dispatch mechanism that enables the broadcast of information to registered observers.
- iOS 2.0+
- macOS 10.0+
- tvOS 9.0+
- watchOS 2.0+
Objects register with a notification center to receive notifications (
NSNotification objects) using the
add methods. When an object adds itself as an observer, it specifies which notifications it should receive. An object may therefore call this method several times in order to register itself as an observer for several different notifications.
Each running app has a
default notification center, and you can create new notification centers to organize communications in particular contexts.
A notification center can deliver notifications only within a single program; if you want to post a notification to other processes or receive notifications from other processes, use