Documentation

ETMutableObjectViewpoint class documentation

ETMutableObjectViewpoint : NSObject <ETPropertyViewpoint>

A proxy giving access to a model property as a mutable object.

AuthorsQuentin Mathe
Declared inETMutableObjectViewpoint.h

Overview

ETMutableObjectViewpoint turns an attribute or to-one relationship property belonging to a represented object, into a mutable object proxy that updates the model property with a new immutable object in reaction to -setValue:forProperty: .

ETMutableObjectViewpoint doesn't work as a mutable collection proxy for a to-many relationship property, you must use ETCollectionViewpoint instead.

Using a mutable object as ETMutableObjectViewpoint value doesn't bring a lot of benefits, but is well supported and works transparently.

For supporting editing a mutable object class, ETMutableObjectViewpoint must be subclassed. For example, for editing NSSortDescriptor, you must implement a new subclass such as ETMutableSortDescriptorViewpoint (this one is provided by EtoileUI though).

This viewpoint uses Key-Value-Observing to detect any property changes on the represented object.


Initialization

+ (id) viewpointWithName: (NSString *)key representedObject: (id)object
Description forthcoming.
    - (id) initWithName: (NSString *)key representedObject: (id)object
    Description forthcoming.

      Property Value Coding

      - (id) valueForProperty: (NSString *)key

      Returns a value bound to a property of the object -value . This method accesses properties of the represented property.

        - (BOOL) setValue: (id)value forProperty: (NSString *)key

        Returns a value bound to a property of the object -value . This method accesses properties of the represented property.

          - (void) setRepresentedObject: (id)object oldObservedKeyPath: (NSString *)oldObservedKeyPath newObservedKeyPath: (NSString *)newObservedKeyPath
          Description forthcoming.
            - (void) startObserveRepresentedObject: (id)anObject forKeyPath: (NSString *)aKeyPath
            Description forthcoming.
              - (void) stopObserveRepresentedObject: (id)anObject forKeyPath: (NSString *)aKeyPath
              Description forthcoming.