Class CPNotification

CPObject
    extended byCPNotification

@implementation CPNotification : CPObject

Represents a notification for posting to an CPNotificationCenter. Consists of a name, an object, and an optional dictionary. The notification center will check for observers registered to receive either notifications with the name, the object, or both and pass the notification instance on to them. To create a notification use one of the class methods. The default init method will throw a CPUnsupportedMethodException.


Method Summary
+(CPNotification)notificationWithName:(CPString)aNotificationName object:(id)anObject
          Creates a new notification with the specified name and object.
+(CPNotification)notificationWithName:(CPString)aNotificationName object:(id)anObject userInfo:(CPDictionary)aUserInfo
          Creates a new notification with the specified name, object and dictionary.
-(id)init
-(CPString)name
          Returns the notification name.
-(id)object
          Returns the notification's object.
-(CPDictionary)userInfo
          Returns the notification's dictionary.

Methods inherited from class CPObject
initialize, alloc, class, instanceMethodForSelector, instancesRespondToSelector, isSubclassOfClass, load, new, setVersion, superclass, version, init, autorelease, awakeAfterUsingCoder, class, classForCoder, classForKeyedArchiver, className, copy, dealloc, description, doesNotRecognizeSelector, forwardInvocation, hash, isEqual, isKindOfClass, isMemberOfClass, isProxy, methodForSelector, methodSignatureForSelector, mutableCopy, performSelector, performSelector, performSelector, release, replacementObjectForArchiver, replacementObjectForCoder, replacementObjectForKeyedArchiver, respondsToSelector, retain, self, superclass


Method Detail

notificationWithName

+(CPNotification)notificationWithName:(CPString)aNotificationName object:(id)anObject
Creates a new notification with the specified name and object.
Parameters:
aNotificationName - the name of the notification
anObject - the associated object
Returns:
the new notification

notificationWithName

+(CPNotification)notificationWithName:(CPString)aNotificationName object:(id)anObject userInfo:(CPDictionary)aUserInfo
Creates a new notification with the specified name, object and dictionary.
Parameters:
aNotificationName - the name of the notification
anObject - the associated object
aUserInfo - the associated dictionary
Returns:
the new notification

init

-(id)init
Throws:
CPUnsupportedMethodException - always, because the method should not be used

name

-(CPString)name
Returns the notification name.

object

-(id)object
Returns the notification's object.

userInfo

-(CPDictionary)userInfo
Returns the notification's dictionary.

Created on Sat Sep 13 14:15:43 PDT 2008