API 0.9.5
CPObject Class Reference

The root class from which most classes are subclassed. More...

#import <CPObject.h>

Inherited by CAAnimation, CALayer, CAMediaTimingFunction, CPAccordionViewItem, CPAnimation, CPArray, CPAttributedString, CPBasePlatform, CPBasePlatformString, CPBezierPath, CPBinder, CPBundle, CPCharacterSet, CPCib, CPCibConnector, CPCoder, CPColor, CPColorPicker, CPController, CPControllerSelectionProxy, CPCookie, CPCursor, CPData, CPDate, CPDecimalNumberHandler, CPDictionary, CPDocumentController, CPDraggingInfo, CPDragServer, CPEnumerator, CPEvent, CPException, CPExpression, CPFlashMovie, CPFont, CPFontManager, CPFormatter, CPGraphicsContext, CPImage, CPIndexPath, CPIndexSet, CPInvocation, CPJSONPConnection, CPKeyBinding, CPMenu, CPMenuItem, CPNinePartImage, CPNotification, CPNotificationCenter, CPNull, CPNumber, CPOperation, CPOperationQueue, CPPasteboard, CPPlatformWindow, CPPredicate, CPPredicateEditorRowTemplate, CPPredicateUtilities, CPPropertyListSerialization, CPRadioGroup, CPResponder, CPRunLoop, CPScanner, CPScreen, CPSet, CPShadow, CPSortDescriptor, CPSound, CPString, CPTableColumn, CPTabViewItem, CPTheme, CPThemeBlend, CPThreePartImage, CPTimer, CPToolbar, CPToolbarItem, CPTreeNode, CPUndoManager, CPURL, CPURLConnection, CPURLRequest, CPURLResponse, CPUserDefaults, CPUserDefaultsStore, CPUserSessionManager, CPValue, CPValueTransformer, CPWebDAVManager, CPWebScriptObject, and RowObject.

List of all members.

Instance Methods

(void) - addObserver:forKeyPath:options:context:
(void) - applyChange:toKeyPath:
(id) - awakeAfterUsingCoder:
(void) - awakeFromCib
(void) - bind:toObject:withKeyPath:options:
(CPDictionary- dictionaryWithValuesForKeys:
(void) - didChange:valuesAtIndexes:forKey:
(void) - didChangeValueForKey:
(void) - didChangeValueForKey:withSetMutation:usingObjects:
(CPArray- exposedBindings
(CPDictionary- infoForBinding:
(id) - mutableArrayValueForKey:
(id) - mutableArrayValueForKeyPath:
(id) - mutableSetValueForKey:
(id) - mutableSetValueForKeyPath:
(void) - removeObserver:forKeyPath:
(void) - setValue:forKey:
(void) - setValue:forKeyPath:
(void) - setValue:forUndefinedKey:
(void) - setValuesForKeysWithDictionary:
(void) - unbind:
(Class) - valueClassForBinding:
(id) - valueForKey:
(id) - valueForKeyPath:
(id) - valueForUndefinedKey:
(void) - willChange:valuesAtIndexes:forKey:
(void) - willChangeValueForKey:
(void) - willChangeValueForKey:withSetMutation:usingObjects:

Class Methods

(BOOL) + accessInstanceVariablesDirectly
(BOOL) + automaticallyNotifiesObserversForKey:
(void) + exposeBinding:
(CPSet+ keyPathsForValuesAffectingValueForKey:

Instance Variables

Class isa

Detailed Description

The root class from which most classes are subclassed.

CPObject is the root class for most Cappuccino classes. Like in Objective-C, you have to declare parent class explicitly in Objective-J, so your custom classes should almost always subclass CPObject or one of its children.

CPObject provides facilities for class allocation and initialization, querying runtime about parent classes and available selectors, using KVC (key-value coding).

When you subclass CPObject, most of the time you override one selector - init. It is called for default initialization of custom object. You must call parent class init in your overridden code:

- (id)init
{
    self = [super init];
    if (self) {
        ... provide default initialization code for your object ...
    }
    return self;
}

One more useful thing to override is description(). This selector is used to provide developer-readable information about object. description selector is often used with CPLog debugging:

- (CPString)description
{
    return [CPString stringWithFormat:"<SomeClass d>", someValue];
}

To get description value you can use %@ specifier everywhere where format specifiers are allowed:

var inst = [[SomeClass alloc] initWithSomeValue:10];
CPLog("Got some class: %", inst);
    would output:
    Got some class: <SomeClass 10> 

Definition at line 27 of file CPCibLoading.j.


Method Documentation

+ (BOOL) accessInstanceVariablesDirectly

Definition at line 34 of file CPKeyValueCoding.j.

- (void) addObserver: (id)  anObserver
forKeyPath: (CPString aPath
options: (unsigned)  options
context: (id)  aContext 

Definition at line 50 of file CPKeyValueObserving.j.

- (void) applyChange: (CPDictionary aChange
toKeyPath: (CPString aKeyPath 

Definition at line 82 of file CPKeyValueObserving.j.

+ (BOOL) automaticallyNotifiesObserversForKey: (CPString aKey

Reimplemented in CPObjectController.

Definition at line 66 of file CPKeyValueObserving.j.

- (id) awakeAfterUsingCoder: (CPCoder aDecoder

Called after an object is unarchived in case a different object should be used in place of it. The default method returns self. Interested subclasses should override this.

Parameters:
aDecoder
Returns:
the original object or it's substitute.

Definition at line 152 of file CPCoder.j.

- (void) awakeFromCib

Reimplemented in CPArrayController, CPButtonBar, CPCollectionView, CPMenu, CPObjectController, and CPWindow.

Definition at line 29 of file CPCibLoading.j.

- (void) bind: (CPString aBinding
toObject: (id)  anObject
withKeyPath: (CPString aKeyPath
options: (CPDictionary options 

Reimplemented in CPTableColumn.

Definition at line 307 of file CPKeyValueBinding.j.

- (CPDictionary) dictionaryWithValuesForKeys: (CPArray keys

Definition at line 129 of file CPKeyValueCoding.j.

- (void) didChange: (CPKeyValueChange)  aChange
valuesAtIndexes: (CPIndexSet indexes
forKey: (CPString aKey 

Definition at line 38 of file CPKeyValueObserving.j.

- (void) didChangeValueForKey: (CPString aKey

Definition at line 30 of file CPKeyValueObserving.j.

- (void) didChangeValueForKey: (CPString aKey
withSetMutation: (CPKeyValueSetMutationKind)  aMutationKind
usingObjects: (CPSet objects 

Definition at line 46 of file CPKeyValueObserving.j.

+ (void) exposeBinding: (CPString aBinding

Definition at line 274 of file CPKeyValueBinding.j.

- (CPArray) exposedBindings

Definition at line 284 of file CPKeyValueBinding.j.

- (CPDictionary) infoForBinding: (CPString aBinding

Definition at line 321 of file CPKeyValueBinding.j.

+ (CPSet) keyPathsForValuesAffectingValueForKey: (CPString aKey

Definition at line 71 of file CPKeyValueObserving.j.

- (id) mutableArrayValueForKey: (id)  aKey

Definition at line 27 of file CPArray+KVO.j.

- (id) mutableArrayValueForKeyPath: (id)  aKeyPath

Definition at line 32 of file CPArray+KVO.j.

- (id) mutableSetValueForKey: (id)  aKey

Definition at line 26 of file CPSet+KVO.j.

- (id) mutableSetValueForKeyPath: (id)  aKeyPath

Definition at line 31 of file CPSet+KVO.j.

- (void) removeObserver: (id)  anObserver
forKeyPath: (CPString aPath 

Reimplemented in CPObjectController, and CPControllerSelectionProxy.

Definition at line 58 of file CPKeyValueObserving.j.

- (void) setValue: (id)  aValue
forKey: (CPString aKey 

Reimplemented in CPControllerSelectionProxy, CPArray, CPDictionary, and CPSet.

Definition at line 174 of file CPKeyValueCoding.j.

- (void) setValue: (id)  aValue
forKeyPath: (CPString aKeyPath 

Reimplemented in CPControllerSelectionProxy, and CPArray.

Definition at line 157 of file CPKeyValueCoding.j.

- (void) setValue: (id)  aValue
forUndefinedKey: (CPString aKey 

Definition at line 243 of file CPKeyValueCoding.j.

- (void) setValuesForKeysWithDictionary: (CPDictionary keyedValues

Definition at line 225 of file CPKeyValueCoding.j.

- (void) unbind: (CPString aBinding

Definition at line 326 of file CPKeyValueBinding.j.

- (Class) valueClassForBinding: (CPString binding

Definition at line 302 of file CPKeyValueBinding.j.

- (id) valueForKey: (CPString aKey

Reimplemented in CPControllerSelectionProxy, CPArray, CPDictionary, CPNull, and CPSet.

Definition at line 39 of file CPKeyValueCoding.j.

- (id) valueForKeyPath: (CPString aKeyPath

Reimplemented in CPControllerSelectionProxy, CPArray, and CPSet.

Definition at line 115 of file CPKeyValueCoding.j.

- (id) valueForUndefinedKey: (CPString aKey

Definition at line 150 of file CPKeyValueCoding.j.

- (void) willChange: (CPKeyValueChange)  aChange
valuesAtIndexes: (CPIndexSet indexes
forKey: (CPString aKey 

Definition at line 34 of file CPKeyValueObserving.j.

- (void) willChangeValueForKey: (CPString aKey

Definition at line 26 of file CPKeyValueObserving.j.

- (void) willChangeValueForKey: (CPString aKey
withSetMutation: (CPKeyValueSetMutationKind)  aMutationKind
usingObjects: (CPSet objects 

Definition at line 42 of file CPKeyValueObserving.j.


Instance Variable Documentation

- (Class) isa [protected]

Definition at line 5 of file CPObject.h.


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Defines