Platforms to show: All Mac Windows Linux Cross-Platform

Back to DRNotificationCenterMBS class.

DRNotificationCenterMBS.addObserver(observer as NSNotificationObserverMBS, name as string="", theObject as Variant=nil)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method DiscRecording MBS MacBase Plugin 10.4 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Adds an entry to the receiver's dispatch table with an observer and optional criteria: notification name and sender.

observer: Object registering as an observer. This value must not be nil.
name: The name of the notification for which to register the observer; that is, only notifications with this name are delivered to the observer. If you pass nil, the notification center doesn't use a notification's name to decide whether to deliver it to the observer.
theObject: The object whose notifications the observer wants to receive; that is, only notifications sent by this sender are delivered to the observer. If you pass nil, the notification center doesn't use a notification's sender to decide whether to deliver it to the observer.

DRNotificationCenterMBS.Constructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method DiscRecording MBS MacBase Plugin 10.4 ✅ Yes ❌ No ❌ No ❌ No Desktop only
The constructor to create a new instance of notification center pointing to the default notification center.

A DRNotificationCenter object (or simply, notification center) is essentially a notification dispatch table. It notifies all observers of notifications meeting specific criteria. This information is encapsulated in NSNotification objects, also known as notifications. Client objects register themselves with the notification center as observers of specific notifications posted by DiscRecording. When an event occurs, DiscRecording posts an appropriate notification to the notification center. The notification center dispatches a message to each registered observer, passing the notification as the sole argument.

There are two main differences between a DRNotificationCenter and the NSNotificationCenter from Foundation. First is that only Disc Recording posts notifications received through this mechanism. You use this to obtain device plug/unplug events, burn status, etc. Second, there can be multple notification centers active at once. Each run loop of your application will have it's own notification center and notifications from that notification center will be posted to the runloop it was created on.

DRNotificationCenterMBS.removeObserver(observer as NSNotificationObserverMBS, name as string, theObject as Variant=nil)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method DiscRecording MBS MacBase Plugin 10.4 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Removes matching entries from the receiver's dispatch table.

notificationObserver: Observer to remove from the dispatch table. Specify an observer to remove only entries for this observer. Must not be nil, or message will have no effect.
notificationName: Name of the notification to remove from dispatch table. Specify a notification name to remove only entries that specify this notification name. When nil, the receiver does not use notification names as criteria for removal.
notificationSender: Sender to remove from the dispatch table. Specify a notification sender to remove only entries that specify this sender. When nil, the receiver does not use notification senders as criteria for removal.

Be sure to invoke this method before the observer object or any object specified in addObserver is deallocated.

The items on this page are in the following plugins: MBS MacBase Plugin.


The biggest plugin in space...