Super class: NSNotificationCenterMBS
|Type||Topic||Plugin||Version||macOS||Windows||Linux||Console & Web||iOS|
|class||Notifications||MBS MacBase Plugin||9.7||Yes||No||No||Yes, macOS only||No|
It takes NSNotification objects and broadcasts them to any objects in other tasks that have registered for the notification with their task's default distributed notification center.
The NSDistributedNotificationCenter class implements a notification center that can distribute notifications asynchronously to tasks other than the one in which the notification was posted. An instance of this class are known as a distributed notification center.
Each task has a default distributed notification center that you access with the defaultCenter class method. There may be different types of distributed notification centers. Currently there is a single type—NSLocalNotificationCenterType. This type of distributed notification center handles notifications that can be sent between tasks on a single computer. For communication between tasks on different computers, use Distributed Objects Programming Topics.
Posting a distributed notification is an expensive operation. The notification gets sent to a system-wide server that distributes it to all the tasks that have objects registered for distributed notifications. The latency between posting the notification and the notification's arrival in another task is unbounded. In fact, when too many notifications are posted and the server's queue fills up, notifications may be dropped.
Subclass of the NSNotificationCenterMBS class.
- property suspended as boolean
- 4 methods
- method addObserver(observer as NSNotificationObserverMBS, name as string, theObject as Variant, suspensionBehavior as Integer)
- method Constructor
- method postNotificationName(name as string, theObject as string, userInfo as dictionary, deliverImmediately as boolean)
- method postNotificationName(name as string, theObject as string, userInfo as dictionary, options as UInt32)
- 3 shared methods
- 6 constants
Super class NSNotificationCenterMBS
- property Handle as Integer
- 8 methods
- method addObserver(observer as NSNotificationObserverMBS, name as string="", theObject as Variant=nil)
- method Constructor
- method postNotification(notification as NSNotificationMBS)
- method postNotificationName(name as string)
- method postNotificationName(name as string, theObject as Variant)
- method postNotificationName(name as string, theObject as Variant, userInfo as dictionary)
- method removeObserver(observer as NSNotificationObserverMBS)
- method removeObserver(observer as NSNotificationObserverMBS, name as string, theObject as Variant=nil)
- shared method defaultCenter as NSNotificationCenterMBS
This class has no sub classes.
Some examples which use this class:
- /MacCocoa/Notifications/NSDistributedNotificationCenterMBS receiver
- /MacCocoa/Notifications/NSDistributedNotificationCenterMBS sender
The items on this page are in the following plugins: MBS MacBase Plugin.
MBS Xojo tutorial videos