Adds an entry to the receiver’s dispatch table with an observer, a notification selector and optional criteria: notification name and sender.
Original signature is '- (void)addObserver:(id)notificationObserver selector:(SEL)notificationSelector name:(NSString *)notificationName object:(NSString *)notificationSender'
Available in Mac OS X v10.0 and later.
Declaration Syntax
C# | Visual Basic | Visual C++ |
public virtual void AddObserverSelectorNameObject( Id notificationObserver, IntPtr notificationSelector, NSString notificationName, NSString notificationSender )
Parameters
- notificationObserver (Id)
- Object registering as an observer. Must not be nil.
- notificationSelector (IntPtr)
- Selector that specifies the message the receiver sends notificationObserver to notify it of the notification posting. Must not be 0.
- notificationName (NSString)
- The name of the notification for which to register the observer; that is, only notifications with this name are delivered to the observer. When nil, the notification center doesn’t use a notification’s name to decide whether to deliver it to the observer.
- notificationSender (NSString)
- The object whose notifications the observer wants to receive; that is, only notifications sent by this sender are delivered to the observer. When nil, the notification center doesn’t use a notification’s sender to decide whether to deliver it to the observer.
Version Information
- Available in Monobjc Bridge: 10.6 (For Mac OS X 10.6 and later), 10.5 (For Mac OS X 10.5 and later)