Instance Method

committedValuesForKeys:

Returns a dictionary of the last fetched or saved values of the managed object for the properties specified by the given keys.

Declaration

- (NSDictionary<NSString *,id> *)committedValuesForKeys:(NSArray<NSString *> *)keys;

Parameters

keys

An array containing names of properties of the receiver, or nil.

Return Value

A dictionary containing the last fetched or saved values of the receiver for the properties specified by keys.

Discussion

nil values are represented by an instance of NSNull.

This method only reports values of properties that are defined as persistent properties of the receiver, not values of transient properties or of custom instance variables.

You can invoke this method with the keys value of nil to retrieve committed values for all the receiver’s properties, as illustrated by the following example.

NSDictionary *allCommittedValues =
        [aManagedObject committedValuesForKeys:nil];

It is more efficient to use nil than to pass an array of all the property keys.

See Also

Managing Change Events

contextShouldIgnoreUnmodeledPropertyChanges

A Boolean value that indicates whether instances of the class should be marked as having changes if an unmodeled property is changed.

- awakeFromFetch

Provides an opportunity to add code into the life cycle of the managed object when it is being fulfilled from a fault.

- awakeFromInsert

Provides an opportunity to add code into the life cycle of the managed object when it is initially created.

- awakeFromSnapshotEvents:

Provides an opportunity to add code into the life cycle of the managed object when it is being fulfilled from a snapshot.

- changedValues

Returns a dictionary containing the keys and (old) values of persistent properties that have been changed since the last fetching or saving of the managed object.

- changedValuesForCurrentEvent

Returns a dictionary containing the keys and old values of persistent properties that have changed since the last posting of NSManagedObjectContextObjectsDidChangeNotification.

- prepareForDeletion

Provides an opportunity to add code into the life cycle of the managed object when it is about to be deleted.

- willSave

Provides an opportunity to add code into the life cycle of the managed object when it is about to be saved.

- didSave

Provides an opportunity to add code into the life cycle of the managed object after the managed object’s context completes a save operation.

- willTurnIntoFault

Provides an opportunity to add code into the life cycle of the managed object before it is converted to a fault.

- didTurnIntoFault

Provides an opportunity to add code into the life cycle of the managed object when it is turned into a fault.

+ fetchRequest

Returns a new fetch request initialized with the entity represented by this subclass.