Sends messages (CPNotification) between objects. More...
#import <CPNotificationCenter.h>
Class Methods | |
(CPNotificationCenter) | + defaultCenter |
Class Methods inherited from CPObject | |
(BOOL) | + accessInstanceVariablesDirectly |
(id) | + alloc |
(id) | + allocWithCoder: |
(BOOL) | + automaticallyNotifiesObserversForKey: |
(void) | + cancelPreviousPerformRequestsWithTarget: |
(void) | + cancelPreviousPerformRequestsWithTarget:selector:object: |
(Class) | + class |
(BOOL) | + conformsToProtocol: |
(void) | + exposeBinding: |
(void) | + initialize |
(IMP) | + instanceMethodForSelector: |
(BOOL) | + instancesImplementSelector: |
(BOOL) | + instancesRespondToSelector: |
(BOOL) | + isBindingExclusive: |
(BOOL) | + isSubclassOfClass: |
(CPSet) | + keyPathsForValuesAffectingValueForKey: |
(void) | + load |
(id) | + new |
(void) | + object:performSelector:withObject:afterDelay:inModes: |
(void) | + setVersion: |
(Class) | + superclass |
(int) | + version |
Sends messages (CPNotification) between objects.
Cappuccino provides a framework for sending messages between objects within a process called notifications. Objects register with an CPNotificationCenter to be informed whenever other objects post CPNotifications to it matching certain criteria. The notification center processes notifications synchronously – that is, control is only returned to the notification poster once every recipient of the notification has received it and processed it.
Definition at line 2 of file CPNotificationCenter.h.
|
implementation |
Adds an object as an observer. The observer will receive notifications with the specified name and/or containing the specified object (depending on if they are nil
.
anObserver | the observing object |
aSelector | the message sent to the observer when a notification occurs |
aNotificationName | the name of the notification the observer wants to watch |
anObject | the object in the notification the observer wants to watch |
Definition at line 77 of file CPNotificationCenter.j.
|
implementation |
Adds an entry to the receiver’s dispatch table with a block, and optional criteria: notification name and sender.
aNotificationName | the name of the notification the observer wants to watch |
anObject | the object in the notification the observer wants to watch |
The | operation queue to which block should be added. If you pass nil, the block is run synchronously on the posting thread. |
block | the block to be executed when the notification is received. |
Definition at line 92 of file CPNotificationCenter.j.
|
implementation |
Returns the application's notification center
Definition at line 48 of file CPNotificationCenter.j.
|
implementation |
Initializes the receiver
Reimplemented from CPObject.
Definition at line 56 of file CPNotificationCenter.j.
|
implementation |
Posts a notification to all observers that match the specified notification's name and object.
aNotification | the notification being posted |
CPInvalidArgumentException | if aNotification is nil |
Definition at line 162 of file CPNotificationCenter.j.
|
implementation |
Posts a new notification with the specified name and object.
aNotificationName | the name of the notification |
anObject | the associated object |
Definition at line 186 of file CPNotificationCenter.j.
|
implementation |
Posts a new notification with the specified name, object, and dictionary.
aNotificationName | the name of the notification name |
anObject | the associated object |
aUserInfo | the associated dictionary |
Definition at line 176 of file CPNotificationCenter.j.
|
implementation |
Unregisters the specified observer from all notifications.
anObserver | the observer to unregister |
Definition at line 124 of file CPNotificationCenter.j.
|
implementation |
Unregisters the specified observer from notifications matching the specified name and/or object.
anObserver | the observer to remove |
aNotificationName | the name of notifications to no longer watch |
anObject | notifications containing this object will no longer be watched |
Definition at line 141 of file CPNotificationCenter.j.