CPNotificationCenter Class Reference

List of all members.

Public Member Functions

(id) - init [implementation]
(void) - addObserver:selector:name:object: [implementation]
(void) - removeObserver: [implementation]
(void) - removeObserver:name:object: [implementation]
(void) - postNotification: [implementation]
(void) - postNotificationName:object:userInfo: [implementation]
(void) - postNotificationName:object: [implementation]

Static Public Member Functions

(CPNotifcationCenter) + defaultCenter [implementation]


Detailed Description

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 35 of file CPNotificationCenter.j.


Member Function Documentation

- (void) addObserver: (id)  anObserver
selector: (SEL)  aSelector
name: (CPString aNotificationName
object: (id)  anObject 
[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.

Parameters:
anObserver the observing object
aSelector the message sent to the observer when a notification occurrs
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 72 of file CPNotificationCenter.j.

+ (CPNotifcationCenter) defaultCenter   [implementation]

Returns the application's notification center

Definition at line 44 of file CPNotificationCenter.j.

- (id) init   [implementation]

Definition at line 52 of file CPNotificationCenter.j.

- (void) postNotification: (CPNotification aNotification   [implementation]

Posts a notification to all observers that match the specified notification's name and object.

Parameters:
aNotification the notification being posted
Exceptions:
CPInvalidArgumentException if aNotification is nil

Definition at line 131 of file CPNotificationCenter.j.

- (void) postNotificationName: (CPString aNotificationName
object: (id)  anObject 
[implementation]

Posts a new notification with the specified name and object.

Parameters:
aNotificationName the name of the notification
anObject the associated object

Definition at line 155 of file CPNotificationCenter.j.

- (void) postNotificationName: (CPString aNotificationName
object: (id)  anObject
userInfo: (CPDictionary aUserInfo 
[implementation]

Posts a new notification with the specified name, object, and dictionary.

Parameters:
aNotificationName the name of the notification name
anObject the associated object
aUserInfo the associated dictionary

Definition at line 145 of file CPNotificationCenter.j.

- (void) removeObserver: (id)  anObserver   [implementation]

Unregisters the specified observer from all notifications.

Parameters:
anObserver the observer to unregister

Definition at line 93 of file CPNotificationCenter.j.

- (void) removeObserver: (id)  anObserver
name: (CPString aNotificationName
object: (id)  anObject 
[implementation]

Unregisters the specified observer from notifications matching the specified name and/or object.

Parameters:
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 110 of file CPNotificationCenter.j.


The documentation for this class was generated from the following file:

Generated on Thu Dec 11 01:55:50 2008 for Cappuccino by  doxygen 1.5.7.1