API  0.9.8
 All Classes Files Functions Variables Typedefs Macros Groups Pages
CPObjectController Class Reference

#import <CPObjectController.h>

+ Inheritance diagram for CPObjectController:

Instance Methods

(void) - add:
 
(void) - addObject:
 
(void) - addObserver:forKeyPath:options:context:
 
(BOOL) - automaticallyPreparesContent
 
(void) - awakeFromCib
 
(BOOL) - canAdd
 
(BOOL) - canRemove
 
(id) - content
 
(void) - encodeWithCoder:
 
(id) - init
 
(id) - initWithCoder:
 
(id) - initWithContent:
 
(BOOL) - isEditable
 
(id) - newObject
 
(Class) - objectClass
 
(id) - observedKeys
 
(void) - prepareContent
 
(void) - remove:
 
(void) - removeObject:
 
(void) - removeObserver:forKeyPath:
 
(CPArray) - selectedObjects
 
(id) - selection
 
(void) - setAutomaticallyPreparesContent:
 
(void) - setContent:
 
(void) - setEditable:
 
(void) - setObjectClass:
 
- Instance Methods inherited from CPController
(BOOL) - commitEditing
 
(void) - discardEditing
 
(BOOL) - isEditing
 
(void) - objectDidBeginEditing:
 
(void) - objectDidEndEditing:
 
- Instance Methods inherited from CPObject
(void) - applyChange:toKeyPath:
 
(id) - autorelease
 
(id) - awakeAfterUsingCoder:
 
(void) - bind:toObject:withKeyPath:options:
 
(Class) - classForCoder
 
(Class) - classForKeyedArchiver
 
(CPString- className
 
(id) - copy
 
(void) - dealloc
 
(CPString- description
 
(CPDictionary- dictionaryWithValuesForKeys:
 
(void) - didChange:valuesAtIndexes:forKey:
 
(void) - didChangeValueForKey:
 
(void) - didChangeValueForKey:withSetMutation:usingObjects:
 
(void) - doesNotRecognizeSelector:
 
(CPArray) - exposedBindings
 
(id) - forwardingTargetForSelector:
 
(void) - forwardInvocation:
 
(unsigned) - hash
 
(BOOL) - implementsSelector:
 
(CPDictionary- infoForBinding:
 
(BOOL) - isEqual:
 
(BOOL) - isKindOfClass:
 
(BOOL) - isMemberOfClass:
 
(BOOL) - isProxy
 
(IMP) - methodForSelector:
 
(CPMethodSignature) - methodSignatureForSelector:
 
(id) - mutableArrayValueForKey:
 
(id) - mutableArrayValueForKeyPath:
 
(id) - mutableCopy
 
(id) - mutableSetValueForKey:
 
(id) - mutableSetValueForKeyPath:
 
(id) - performSelector:
 
(id) - performSelector:withObject:
 
(void) - performSelector:withObject:afterDelay:
 
(void) - performSelector:withObject:afterDelay:inModes:
 
(id) - performSelector:withObject:withObject:
 
(id) - performSelector:withObjects:
 
(void) - release
 
(id) - replacementObjectForArchiver:
 
(id) - replacementObjectForCoder:
 
(id) - replacementObjectForKeyedArchiver:
 
(BOOL) - respondsToSelector:
 
(id) - retain
 
(id) - self
 
(void) - setValue:forKey:
 
(void) - setValue:forKeyPath:
 
(void) - setValue:forUndefinedKey:
 
(void) - setValuesForKeysWithDictionary:
 
(CPString- UID
 
(void) - unbind:
 
(Class) - valueClassForBinding:
 
(id) - valueForKey:
 
(id) - valueForKeyPath:
 
(id) - valueForUndefinedKey:
 
(void) - willChange:valuesAtIndexes:forKey:
 
(void) - willChangeValueForKey:
 
(void) - willChangeValueForKey:withSetMutation:usingObjects:
 

Class Methods

(BOOL) + automaticallyNotifiesObserversForKey:
 
(void) + initialize
 
(CPSet) + keyPathsForValuesAffectingCanAdd
 
(CPSet) + keyPathsForValuesAffectingCanInsert
 
(CPSet) + keyPathsForValuesAffectingCanRemove
 
(CPSet) + keyPathsForValuesAffectingContentObject
 

Detailed Description

CPObjectController is a bindings-compatible controller class. Properties of the content object of an object of this class can be bound to user interface elements to change and access their values.

The content of an CPObjectController instance is an CPMutableDictionary object by default. This allows a single CPObjectController instance to be used to manage several properties accessed by key value paths. The default content object class can be changed by calling setObjectClass:, which a subclass must override.

Definition at line 2 of file CPObjectController.h.

Method Documentation

- (void) add: (id)  aSender
implementation

Creates and adds a sets the object as the controller's content.

Parameters
idaSender - The sender of the message.

Reimplemented in CPArrayController.

Definition at line 249 of file CPObjectController.j.

- (void) addObject: (id)  anObject
implementation

Sets the controller's content object.

Parameters
idanObject - The object to set for the controller.

Reimplemented in CPArrayController.

Definition at line 224 of file CPObjectController.j.

- (void) addObserver: (id)  anObserver
forKeyPath: (CPString aKeyPath
options: (CPKeyValueObservingOptions)  options
context: (id)  context 
implementation

Reimplemented from CPObject.

Definition at line 343 of file CPObjectController.j.

+ (BOOL) automaticallyNotifiesObserversForKey: (CPString aKey
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 from CPObject.

Definition at line 62 of file CPObjectController.j.

- (BOOL) automaticallyPreparesContent
implementation

Returns if the controller prepares the content automatically.

Returns
BOOL - YES if the content is prepared, otherwise NO.

Definition at line 171 of file CPObjectController.j.

- (void) awakeFromCib
implementation

Reimplemented from CPObject.

Reimplemented in CPArrayController.

Provided by category CPObjectController(CPCoding).

Definition at line 397 of file CPObjectController.j.

- (BOOL) canAdd
implementation
Returns
BOOL - YES if you can added to the controller using add:

Definition at line 258 of file CPObjectController.j.

- (BOOL) canRemove
implementation
Returns
BOOL - Returns YES if you can remove the controller's content using remove:

Definition at line 276 of file CPObjectController.j.

- (id) content
implementation

Returns the controller's content object.

Returns
id - The content object of the controller.

Definition at line 119 of file CPObjectController.j.

- (void) encodeWithCoder: (CPCoder aCoder
implementation

Reimplemented from CPController.

Reimplemented in CPArrayController, and CPDictionaryController.

Provided by category CPObjectController(CPCoding).

Definition at line 384 of file CPObjectController.j.

- (id) init
implementation

Reimplemented from CPController.

Reimplemented in CPArrayController, and CPDictionaryController.

Definition at line 88 of file CPObjectController.j.

+ (void) initialize
implementation

Reimplemented from CPObject.

Reimplemented in CPArrayController.

Definition at line 48 of file CPObjectController.j.

- (id) initWithCoder: (CPCoder aCoder
implementation

Reimplemented from CPController.

Reimplemented in CPArrayController, and CPDictionaryController.

Provided by category CPObjectController(CPCoding).

Definition at line 364 of file CPObjectController.j.

- (id) initWithContent: (id)  aContent
implementation

Inits and returns a CPObjectController object with the given content.

Parameters
idaContent - The object the controller will use.
Returns
id the CPObjectConroller instance.

Definition at line 99 of file CPObjectController.j.

- (BOOL) isEditable
implementation
Returns
BOOL - Returns YES if the content of the controller is editable, otherwise NO.

Definition at line 293 of file CPObjectController.j.

+ (CPSet) keyPathsForValuesAffectingCanAdd
implementation

Definition at line 70 of file CPObjectController.j.

+ (CPSet) keyPathsForValuesAffectingCanInsert
implementation

Definition at line 75 of file CPObjectController.j.

+ (CPSet) keyPathsForValuesAffectingCanRemove
implementation

Reimplemented in CPArrayController.

Definition at line 80 of file CPObjectController.j.

+ (CPSet) keyPathsForValuesAffectingContentObject
implementation

Definition at line 57 of file CPObjectController.j.

- (id) newObject
implementation

Creates and returns a new object of the appropriate class.

Returns
id - The object created.

Reimplemented in CPDictionaryController.

Definition at line 215 of file CPObjectController.j.

- (Class) objectClass
implementation

Returns the class of what new objects will be when they are created.

Returns
Class - The class of new objects.

Definition at line 198 of file CPObjectController.j.

- (id) observedKeys
implementation
Returns
id - Returns the keys which are being observed.

Definition at line 338 of file CPObjectController.j.

- (void) prepareContent
implementation

Overridden by a subclass that require control over the creation of new objects.

Reimplemented in CPArrayController.

Definition at line 179 of file CPObjectController.j.

- (void) remove: (id)  aSender
implementation

Removes the content object from the controller.

Parameters
idaSender - The sender of the message.

Reimplemented in CPArrayController.

Definition at line 267 of file CPObjectController.j.

- (void) removeObject: (id)  anObject
implementation

Removes a given object from the controller.

Parameters
idanObject - The object to remove from the receiver.

Reimplemented in CPArrayController.

Definition at line 236 of file CPObjectController.j.

- (void) removeObserver: (id)  anObserver
forKeyPath: (CPString aKeyPath 
implementation

Reimplemented from CPObject.

Definition at line 349 of file CPObjectController.j.

- (CPArray) selectedObjects
implementation
Returns
CPArray - Returns an array of all objects to be affected by editing.

Reimplemented in CPArrayController.

Definition at line 301 of file CPObjectController.j.

- (id) selection
implementation

Returns a proxy object representing the controller's selection.

Definition at line 309 of file CPObjectController.j.

- (void) setAutomaticallyPreparesContent: (BOOL)  shouldAutomaticallyPrepareContent
implementation

Sets whether the controller automatically creates and inserts new content objects automatically when loading from a cib file. If you pass YES and the controller uses prepareContent to create the content object. The default is NO.

Parameters
BOOLshouldAutomaticallyPrepareContent - YES if the content should be prepared, otherwise NO.

Definition at line 162 of file CPObjectController.j.

- (void) setContent: (id)  aContent
implementation

Sets the content object for the controller.

Parameters
idaContent - The new content object for the controller.

Reimplemented in CPArrayController.

Definition at line 128 of file CPObjectController.j.

- (void) setEditable: (BOOL)  shouldBeEditable
implementation

Sets whether the controller allows for the editing of the content.

Parameters
BOOLshouldBeEditable - YES if the content should be editable, otherwise NO.

Definition at line 285 of file CPObjectController.j.

- (void) setObjectClass: (Class)  aClass
implementation

Sets the object class when creating new objects.

Parameters
Class- the class of new objects that will be created.

Definition at line 188 of file CPObjectController.j.


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