Platforms to show: All Mac Windows Linux Cross-Platform

NSNotificationCenterMBS.addObserver(observer as NSNotificationObserverMBS, name as string="", theObject as Variant=nil)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Notifications MBS MacBase Plugin 9.7 Yes No No Yes, macOS only No
Function: Adds an entry to the receiver's dispatch table with an observer and optional criteria: notification name and sender.
Notes:
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.

Feedback, Comments & Corrections

NSNotificationCenterMBS.Constructor
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Notifications MBS MacBase Plugin 9.7 Yes No No Yes, macOS only No
Function: The constructor to create a new instance of notification center pointing to the default notification center.
Notes: The current task's default notification center, which is used for system notifications.

Feedback, Comments & Corrections

NSNotificationCenterMBS.postNotification(notification as NSNotificationMBS)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Notifications MBS MacBase Plugin 9.7 Yes No No Yes, macOS only No
Function: Posts a given notification to the receiver.
Notes: notification: The notification to post. This value must not be nil.

Feedback, Comments & Corrections

NSNotificationCenterMBS.postNotificationName(name as string)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Notifications MBS MacBase Plugin 9.7 Yes No No Yes, macOS only No
Function: Creates a notification with a given name and sender and posts it to the receiver.
Notes:
name: The name of the notification.
theObject: The object posting the notification.

See also:

Feedback, Comments & Corrections

NSNotificationCenterMBS.postNotificationName(name as string, theObject as Variant)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Notifications MBS MacBase Plugin 9.7 Yes No No Yes, macOS only No
Function: Creates a notification with a given name and sender and posts it to the receiver.
Notes:
name: The name of the notification.
theObject: The object posting the notification.

See also:

Feedback, Comments & Corrections

NSNotificationCenterMBS.postNotificationName(name as string, theObject as Variant, userInfo as dictionary)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Notifications MBS MacBase Plugin 9.7 Yes No No Yes, macOS only No
Function: Creates a notification with a given name, sender, and information and posts it to the receiver.
Notes:
name: The name of the notification.
theObject: The object posting the notification.
userInfo: Information about the the notification. May be nil.

This method is the preferred method for posting notifications.

See also:

Feedback, Comments & Corrections

NSNotificationCenterMBS.removeObserver(observer as NSNotificationObserverMBS)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Notifications MBS MacBase Plugin 9.7 Yes No No Yes, macOS only No
Function: Removes all the entries specifying a given observer from the receiver's dispatch table.
Notes:
observer: The observer to remove. Must not be nil.

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

See also:

Feedback, Comments & Corrections

NSNotificationCenterMBS.removeObserver(observer as NSNotificationObserverMBS, name as string, theObject as Variant=nil)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Notifications MBS MacBase Plugin 9.7 Yes No No Yes, macOS only No
Function: Removes matching entries from the receiver's dispatch table.
Notes:
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.

See also:

Feedback, Comments & Corrections

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

The biggest plugin in space...




Links
MBS Xojo blog