![]() |
API
0.9.6
|
The root class from which most classes are subclassed. More...
#import <CPObject.h>
Inherited by CAAnimation, CALayer, CAMediaTimingFunction, CPAccordionViewItem, CPAlert, CPAnimation, CPArray, CPAttributedString, CPBasePlatform, CPBasePlatformString, CPBezierPath, CPBinder, CPBundle, CPCharacterSet, CPCib, CPCibConnector, CPCoder, CPColor, CPColorPicker, CPColorSpace, CPController, CPControllerSelectionProxy, CPCookie, CPCursor, CPData, CPDate, CPDecimalNumberHandler, CPDictionary, CPDocumentController, CPDraggingInfo, CPDragServer, CPEnumerator, CPEvent, CPException, CPExpression, CPFlashMovie, CPFont, CPFontManager, CPFormatter, CPGradient, CPGraphicsContext, CPImage, CPIndexPath, CPIndexSet, CPInvocation, CPJSONPConnection, CPKeyBinding, CPMenu, CPMenuItem, CPNinePartImage, CPNotification, CPNotificationCenter, CPNull, CPNumber, CPOperation, CPOperationQueue, CPPasteboard, CPPlatformWindow, CPPredicate, CPPredicateEditorRowTemplate, 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 CPWorkspace.
Class Methods | |
(BOOL) | + accessInstanceVariablesDirectly |
(id) | + alloc |
(id) | + allocWithCoder: |
(BOOL) | + automaticallyNotifiesObserversForKey: |
(Class) | + class |
(void) | + exposeBinding: |
(void) | + initialize |
(IMP) | + instanceMethodForSelector: |
(BOOL) | + instancesRespondToSelector: |
(BOOL) | + isSubclassOfClass: |
(CPSet) | + keyPathsForValuesAffectingValueForKey: |
(void) | + load |
(id) | + new |
(void) | + setVersion: |
(Class) | + superclass |
(int) | + version |
Instance Variables | |
Class | isa |
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: <pre>- (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 2 of file CPObject.h.
|
implementation |
Provided by category CPObject(CPKeyValueCoding).
Definition at line 34 of file CPKeyValueCoding.j.
|
implementation |
Provided by category CPObject(KeyValueObserving).
Definition at line 131 of file CPKeyValueObserving.j.
|
implementation |
Allocates a new instance of the receiving class
Reimplemented in CPArray, CPString, CPSet, CPNumber, CPDate, CPURL, CPException, CPData, CPDecimalNumber, and CPDictionary.
Definition at line 90 of file CPObject.j.
|
implementation |
Definition at line 96 of file CPObject.j.
|
implementation |
Provided by category CPObject(KeyValueObserving).
Definition at line 179 of file CPKeyValueObserving.j.
|
implementation |
Whether -willChangeValueForKey/-didChangeValueForKey should automatically be invoked when the setter of the given key is used. The default is YES. If you override this method to return NO for some key, you will need to call -willChangeValueForKey/-didChangeValueForKey manually to be KVO compliant.
The default implementation of this method will check if the receiving class implements + (BOOL)automaticallyNotifiesObserversOf<aKey>
and return the response of that method if it exists.
Reimplemented in CPObjectController.
Provided by category CPObject(KeyValueObserving).
Definition at line 157 of file CPKeyValueObserving.j.
|
implementation |
|
implementation |
Subclasses override this method to possibly substitute the unarchived object with another. This would be useful if your program utilizes a flyweight pattern. The method is called by CPCoder.
aCoder | the coder that contained the receiver's data |
Provided by category CPObject(CPCoding).
Definition at line 383 of file CPObject.j.
|
implementation |
Reimplemented in CPWindow, CPScrollView, CPCollectionView, CPMenu, CPArrayController, CPObjectController, and CPButtonBar.
Provided by category CPObject(CPCibLoading).
Definition at line 29 of file CPCibLoading.j.
|
implementation |
Reimplemented in CPTableView, and CPTableColumn.
Provided by category CPObject(KeyValueBindingCreation).
Definition at line 384 of file CPKeyValueBinding.j.
|
implementation |
Returns the Class object for this class definition.
Returns the receiver's Class
Definition at line 139 of file CPObject.j.
|
implementation |
Can be overridden by subclasses to substitute a different class to represent the receiver during coding.
Definition at line 401 of file CPObject.j.
|
implementation |
Can be overridden by subclasses to substitute a different class to represent the receiver for keyed archiving.
nil
means to ignore the method result. Definition at line 392 of file CPObject.j.
|
implementation |
Returns the class name
Definition at line 457 of file CPObject.j.
|
implementation |
Makes a deep copy of the receiver. The copy should be functionally equivalent to the receiver.
Reimplemented in CPArray, CPSet, CPDate, CPException, CPFont, CPMenuItem, CPToolbarItem, CPIndexSet, CPScanner, and CPDictionary.
Definition at line 114 of file CPObject.j.
|
implementation |
Not necessary to call in Objective-J. Only exists for code compatibility.
Definition at line 131 of file CPObject.j.
|
implementation |
Returns a human readable string describing the receiver
Reimplemented in CPArray, CPString, CPSet, CPNumber, CPDate, CPURL, CPException, CPData, CPEvent, CPIndexPath, CPKeyBinding, CPColor, CPFont, CPMenuItem, CPImage, CPDecimalNumber, CPIndexSet, CPBundle, CPSortDescriptor, CPScanner, CPDictionary, and CPPredicate.
Definition at line 288 of file CPObject.j.
|
implementation |
Provided by category CPObject(CPKeyValueCoding).
Definition at line 129 of file CPKeyValueCoding.j.
|
implementation |
Provided by category CPObject(KeyValueObserving).
Definition at line 79 of file CPKeyValueObserving.j.
|
implementation |
Provided by category CPObject(KeyValueObserving).
Definition at line 43 of file CPKeyValueObserving.j.
|
implementation |
Provided by category CPObject(KeyValueObserving).
Definition at line 115 of file CPKeyValueObserving.j.
|
implementation |
Called by the Objective-J runtime when an object can't respond to a message. It's not recommended to call this method directly, unless you need your class to not support a method that it has inherited from a super class.
Definition at line 367 of file CPObject.j.
|
implementation |
Provided by category CPObject(KeyValueBindingCreation).
Definition at line 351 of file CPKeyValueBinding.j.
|
implementation |
Provided by category CPObject(KeyValueBindingCreation).
Definition at line 361 of file CPKeyValueBinding.j.
|
implementation |
Definition at line 344 of file CPObject.j.
|
implementation |
Subclasses can override this method to forward message to other objects. Overwriting this method in conjunction with -methodSignatureForSelector
: allows the receiver to forward messages for which it does not respond, to another object that does.
Definition at line 356 of file CPObject.j.
|
implementation |
Returns a hash for the object
Definition at line 477 of file CPObject.j.
|
implementation |
Tests whether the receiver implements to the provided selector regardless of inheritance.
aSelector | the selector for which to test the receiver |
YES
if the receiver implements the selector Definition at line 239 of file CPObject.j.
|
implementation |
Provided by category CPObject(KeyValueBindingCreation).
Definition at line 398 of file CPKeyValueBinding.j.
|
implementation |
Initializes the receiver
Reimplemented in CPCharacterSet, CPArray, CPSet, CPWindow, CPURL, CPWebDAVManager, CPRadioGroup, CPUndoManager, CPView, CPRunLoop, CPDragServer, CALayer, CPToolbar, CPDateFormatter, CPDocument, CPApplication, CPAlert, CPMenuItem, CPImage, CPColorPanel, CPOperation, CPViewController, CPToolbarItem, CPMenu, CPNumberFormatter, CPPopover, CPTabViewItem, CPTableColumn, CPFontManager, CPUserDefaults, CPUserDefaultsLocalStore, CPWindowController, CPArrayController, CPSound, CPBezierPath, CPObjectController, CPNotificationCenter, CPNotification, CPDecimalNumberHandler, CPDecimalNumber, CPURLRequest, CPIndexSet, CPUserSessionManager, CPAccordionViewItem, CPDocumentController, CPOperationQueue, CPSavePanel, CPPlatformWindow, CAAnimation, CPController, CPFunctionOperation, and CPInvocationOperation.
Definition at line 105 of file CPObject.j.
|
implementation |
Reimplemented in CPWindow, CPView, CPValueTransformer, CPRunLoop, CPKeyBinding, CPDragServer, CPFont, CPScrollView, CPKeyedArchiver, CPKeyedUnarchiver, CPToolbar, CPControl, CPSplitView, CPViewController, CPProgressIndicator, CPMenu, CPPasteboard, CPSearchField, CPLevelIndicator, CPImageView, CPArrayController, CPObjectController, CPShadowView, and CPCursor.
Definition at line 73 of file CPObject.j.
|
implementation |
Returns the implementation of the receiving class' method for the provided selector.
aSelector | the selector for the class method to return |
Definition at line 268 of file CPObject.j.
|
implementation |
Test whether instances of this class respond to the provided selector.
aSelector | the selector for which to test the class |
YES
if instances of the class respond to the selector Definition at line 218 of file CPObject.j.
|
implementation |
Determines if anObject
is functionally equivalent to the receiver.
YES
if anObject
is functionally equivalent to the receiver. Reimplemented in CPArray, CPString, CPURL, CPException, CPComparisonPredicate, CPIndexPath, CPFont, CPCompoundPredicate, CPAttributedString, CPIndexSet, CPDictionary, CPNull, and CPPredicate_BOOL.
Definition at line 494 of file CPObject.j.
|
implementation |
Returns YES
if the receiver is a aClass
type, or a subtype of it.
aClass | the class to test as the receiver's class or super class. |
Definition at line 179 of file CPObject.j.
|
implementation |
Returns YES
if the receiver is of the aClass
class type.
aClass | the class to test the receiver |
Definition at line 193 of file CPObject.j.
|
implementation |
Determines whether the receiver's root object is a proxy.
YES
if the root object is a proxy Definition at line 207 of file CPObject.j.
|
implementation |
Returns YES
if the receiving class is a subclass of aClass
.
aClass | the class to test inheritance from |
Definition at line 164 of file CPObject.j.
Provided by category CPObject(KeyValueObserving).
Definition at line 168 of file CPKeyValueObserving.j.
|
implementation |
Reimplemented in CPTableView, and CPImage.
Definition at line 69 of file CPObject.j.
|
implementation |
Returns the implementation of the receiver's method for the provided selector.
aSelector | the selector for the method to return |
Definition at line 258 of file CPObject.j.
|
implementation |
Returns the method signature for the provided selector.
aSelector | the selector for which to find the method signature |
Definition at line 278 of file CPObject.j.
|
implementation |
Provided by category CPObject(CPArrayKVO).
Definition at line 27 of file CPArray+KVO.j.
|
implementation |
Provided by category CPObject(CPArrayKVO).
Definition at line 32 of file CPArray+KVO.j.
|
implementation |
Creates a deep mutable copy of the receiver.
Reimplemented in CPSet, CPArray, CPMenuItem, and CPIndexSet.
Definition at line 123 of file CPObject.j.
|
implementation |
Provided by category CPObject(CPSetKVO).
Definition at line 26 of file CPSet+KVO.j.
|
implementation |
Provided by category CPObject(CPSetKVO).
Definition at line 31 of file CPSet+KVO.j.
|
implementation |
Allocates a new instance of the receiver, and sends it an -init
Definition at line 82 of file CPObject.j.
|
implementation |
Sends the specified message to the receiver.
aSelector | the message to send |
Definition at line 304 of file CPObject.j.
|
implementation |
Sends the specified message to the receiver, with one argument.
aSelector | the message to send |
anObject | the message argument |
Definition at line 315 of file CPObject.j.
|
implementation |
Sends the specified message to the receiver, with two arguments.
aSelector | the message to send |
anObject | the first message argument |
anotherObject | the second message argument |
Definition at line 327 of file CPObject.j.
|
implementation |
Sends the specified message to the reciever, with any number of arguments.
aSelector | the message to send |
anObject... | comma seperated objects to pass to the selector |
Definition at line 338 of file CPObject.j.
|
implementation |
Does nothing.
Definition at line 511 of file CPObject.j.
|
implementation |
Reimplemented in CPControllerSelectionProxy, CPArray, and CPObjectController.
Provided by category CPObject(KeyValueObserving).
Definition at line 139 of file CPKeyValueObserving.j.
|
implementation |
Can be overridden by subclasses to substitute another object during archiving.
anArchiver | that archiver |
Definition at line 411 of file CPObject.j.
|
implementation |
Can be overridden by subclasses to substitute another object during coding.
aCoder | the coder |
Definition at line 431 of file CPObject.j.
|
implementation |
Can be overridden by subclasses to substitute another object during keyed archiving.
anArchive | the keyed archiver |
Definition at line 421 of file CPObject.j.
|
implementation |
Tests whether the receiver responds to the provided selector.
aSelector | the selector for which to test the receiver |
YES
if the receiver responds to the selector Definition at line 228 of file CPObject.j.
|
implementation |
|
implementation |
Returns the receiver.
Definition at line 518 of file CPObject.j.
|
implementation |
Reimplemented in CPControllerSelectionProxy, CPSet, CPArray, and CPDictionary.
Provided by category CPObject(CPKeyValueCoding).
Definition at line 174 of file CPKeyValueCoding.j.
|
implementation |
Reimplemented in CPControllerSelectionProxy, and CPArray.
Provided by category CPObject(CPKeyValueCoding).
Definition at line 157 of file CPKeyValueCoding.j.
|
implementation |
Provided by category CPObject(CPKeyValueCoding).
Definition at line 243 of file CPKeyValueCoding.j.
|
implementation |
Provided by category CPObject(CPKeyValueCoding).
Definition at line 225 of file CPKeyValueCoding.j.
|
implementation |
Sets the class version number.
the | new version number for the class |
Definition at line 440 of file CPObject.j.
|
implementation |
Returns the class object super class
Returns the receiver's super class.
Definition at line 155 of file CPObject.j.
|
implementation |
Reimplemented in CPString, and CPNumber.
Definition at line 482 of file CPObject.j.
|
implementation |
Provided by category CPObject(KeyValueBindingCreation).
Definition at line 403 of file CPKeyValueBinding.j.
|
implementation |
Provided by category CPObject(KeyValueBindingCreation).
Definition at line 379 of file CPKeyValueBinding.j.
|
implementation |
Reimplemented in CPControllerSelectionProxy, CPSet, CPArray, CPDictionary, and CPNull.
Provided by category CPObject(CPKeyValueCoding).
Definition at line 39 of file CPKeyValueCoding.j.
|
implementation |
Reimplemented in CPControllerSelectionProxy, CPArray, and CPSet.
Provided by category CPObject(CPKeyValueCoding).
Definition at line 115 of file CPKeyValueCoding.j.
|
implementation |
Provided by category CPObject(CPKeyValueCoding).
Definition at line 150 of file CPKeyValueCoding.j.
|
implementation |
Returns the class version number.
Definition at line 448 of file CPObject.j.
|
implementation |
Provided by category CPObject(KeyValueObserving).
Definition at line 62 of file CPKeyValueObserving.j.
|
implementation |
Provided by category CPObject(KeyValueObserving).
Definition at line 26 of file CPKeyValueObserving.j.
|
implementation |
Provided by category CPObject(KeyValueObserving).
Definition at line 98 of file CPKeyValueObserving.j.
|
protected |
Definition at line 5 of file CPObject.h.