Adds an entry to the receiver’s dispatch table with a notification queue and a block to add to the queue, and optional criteria: notification name and sender.
Original signature is '- (id)addObserverForName:(NSString *)name object:(id)obj queue:(NSOperationQueue *)queue usingBlock:(void (^)(NSNotification *))block'
Available in Mac OS X v10.6 and later.
Declaration Syntax
C# | Visual Basic | Visual C++ |
public virtual Id AddObserverForNameObjectQueueUsingBlock( NSString name, Id obj, NSOperationQueue queue, Action<NSNotification> block )
Public Overridable Function AddObserverForNameObjectQueueUsingBlock ( _ name As NSString, _ obj As Id, _ queue As NSOperationQueue, _ block As Action(Of NSNotification) _ ) As Id
public: virtual Id^ AddObserverForNameObjectQueueUsingBlock( NSString^ name, Id^ obj, NSOperationQueue^ queue, Action<NSNotification^>^ block )
Parameters
- name (NSString)
- The name of the notification for which to register the observer; that is, only notifications with this name are used to add the block to the operation queue.
- obj (Id)
- The object whose notifications you want to add the block to the operation queue.
- queue (NSOperationQueue)
- The operation queue to which block should be added.
- block (Action<(Of <(<'NSNotification>)>)>)
- The block to be executed when the notification is received.
Return Value
An opaque object to act as the observer.
Version Information
- Available in Monobjc Bridge: 10.6 (For Mac OS X 10.6 and later)