API  1.0.0
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:
 
(CPString- entityName
 
(CPPredicate) - fetchPredicate
 
(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) - setEntityName:
 
(void) - setFetchPredicate:
 
(void) - setObjectClass:
 
(void) - setUsesLazyFetching:
 
(BOOL) - usesLazyFetching
 
- 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
 
- Class Methods inherited from CPObject
(BOOL) + accessInstanceVariablesDirectly
 
(id) + alloc
 
(id) + allocWithCoder:
 
(void) + cancelPreviousPerformRequestsWithTarget:
 
(void) + cancelPreviousPerformRequestsWithTarget:selector:object:
 
(Class) + class
 
(BOOL) + conformsToProtocol:
 
(void) + exposeBinding:
 
(IMP) + instanceMethodForSelector:
 
(BOOL) + instancesImplementSelector:
 
(BOOL) + instancesRespondToSelector:
 
(BOOL) + isBindingExclusive:
 
(BOOL) + isSubclassOfClass:
 
(CPSet) + keyPathsForValuesAffectingValueForKey:
 
(void) + load
 
(id) + new
 
(void) + object:performSelector:withObject:afterDelay:inModes:
 
(void) + setVersion:
 
(Class) + superclass
 
(int) + version
 

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

◆ add:()

- (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 300 of file CPObjectController.j.

◆ addObject:()

- (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 275 of file CPObjectController.j.

◆ addObserver:forKeyPath:options:context:()

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

Reimplemented from CPObject.

Definition at line 394 of file CPObjectController.j.

◆ automaticallyNotifiesObserversForKey:()

+ (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 66 of file CPObjectController.j.

◆ automaticallyPreparesContent()

- (BOOL) automaticallyPreparesContent
implementation

Returns if the controller prepares the content automatically.

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

Definition at line 175 of file CPObjectController.j.

◆ awakeFromCib()

- (void) awakeFromCib
implementation

Reimplemented from CPObject.

Reimplemented in CPArrayController.

Provided by category CPObjectController(CPCoding).

Definition at line 462 of file CPObjectController.j.

◆ canAdd()

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

Definition at line 309 of file CPObjectController.j.

◆ canRemove()

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

Definition at line 327 of file CPObjectController.j.

◆ content()

- (id) content
implementation

Returns the controller's content object.

Returns
id - The content object of the controller.

Definition at line 123 of file CPObjectController.j.

◆ encodeWithCoder:()

- (void) encodeWithCoder: (CPCoder aCoder
implementation

Reimplemented from CPController.

Reimplemented in CPArrayController, and CPDictionaryController.

Provided by category CPObjectController(CPCoding).

Definition at line 444 of file CPObjectController.j.

◆ entityName()

- (CPString) entityName
implementation

Returns the entity name.

Returns
CPString - The name of the entity.

Definition at line 201 of file CPObjectController.j.

◆ fetchPredicate()

- (CPPredicate) fetchPredicate
implementation

Returns the fetch predicate.

Returns
CPPredicate - The predicate used to fetch content.

Definition at line 221 of file CPObjectController.j.

◆ init()

- (id) init
implementation

Reimplemented from CPController.

Reimplemented in CPArrayController, and CPDictionaryController.

Definition at line 92 of file CPObjectController.j.

◆ initialize()

+ (void) initialize
implementation

Reimplemented from CPObject.

Reimplemented in CPArrayController.

Definition at line 52 of file CPObjectController.j.

◆ initWithCoder:()

- (id) initWithCoder: (CPCoder aCoder
implementation

Reimplemented from CPController.

Reimplemented in CPArrayController, and CPDictionaryController.

Provided by category CPObjectController(CPCoding).

Definition at line 418 of file CPObjectController.j.

◆ initWithContent:()

- (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 103 of file CPObjectController.j.

◆ isEditable()

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

Definition at line 344 of file CPObjectController.j.

◆ keyPathsForValuesAffectingCanAdd()

+ (CPSet) keyPathsForValuesAffectingCanAdd
implementation

Definition at line 74 of file CPObjectController.j.

◆ keyPathsForValuesAffectingCanInsert()

+ (CPSet) keyPathsForValuesAffectingCanInsert
implementation

Definition at line 79 of file CPObjectController.j.

◆ keyPathsForValuesAffectingCanRemove()

+ (CPSet) keyPathsForValuesAffectingCanRemove
implementation

Reimplemented in CPArrayController.

Definition at line 84 of file CPObjectController.j.

◆ keyPathsForValuesAffectingContentObject()

+ (CPSet) keyPathsForValuesAffectingContentObject
implementation

Definition at line 61 of file CPObjectController.j.

◆ newObject()

- (id) newObject
implementation

Creates and returns a new object of the appropriate class.

Returns
id - The object created.

Reimplemented in CPDictionaryController.

Definition at line 266 of file CPObjectController.j.

◆ objectClass()

- (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 249 of file CPObjectController.j.

◆ observedKeys()

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

Definition at line 389 of file CPObjectController.j.

◆ prepareContent()

- (void) prepareContent
implementation

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

Reimplemented in CPArrayController.

Definition at line 229 of file CPObjectController.j.

◆ remove:()

- (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 318 of file CPObjectController.j.

◆ removeObject:()

- (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 287 of file CPObjectController.j.

◆ removeObserver:forKeyPath:()

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

Reimplemented from CPObject.

Definition at line 400 of file CPObjectController.j.

◆ selectedObjects()

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

Reimplemented in CPArrayController.

Definition at line 352 of file CPObjectController.j.

◆ selection()

- (id) selection
implementation

Returns a proxy object representing the controller's selection.

Definition at line 360 of file CPObjectController.j.

◆ setAutomaticallyPreparesContent:()

- (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 166 of file CPObjectController.j.

◆ setContent:()

- (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 132 of file CPObjectController.j.

◆ setEditable:()

- (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 336 of file CPObjectController.j.

◆ setEntityName:()

- (void) setEntityName: (CPString newEntityName
implementation

Sets the entity name the controller handles.

Parameters
CPStringnewEntityName - The new entity name.

Definition at line 185 of file CPObjectController.j.

◆ setFetchPredicate:()

- (void) setFetchPredicate: (CPPredicate)  newPredicate
implementation

Sets the predicate used to fetch content.

Parameters
CPPredicatenewPredicate - The fetch predicate.

Definition at line 211 of file CPObjectController.j.

◆ setObjectClass:()

- (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 239 of file CPObjectController.j.

◆ setUsesLazyFetching:()

- (void) setUsesLazyFetching: (BOOL)  aValue
implementation

Synthesized accessor method.

Provided by category CPObjectController(CPSynthesizedAccessors).

Definition at line 936 of file CPObjectController.j.

◆ usesLazyFetching()

- (BOOL) usesLazyFetching
implementation

Synthesized accessor method.

Provided by category CPObjectController(CPSynthesizedAccessors).

Definition at line 928 of file CPObjectController.j.


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