Parameters

A dictionary containing the values persisted in an external store with keys corresponding to the names of the property description in the NSEntityDescription object described by objectID:

For attributes: an immutable value (an instance of a value class such as NSNumber, NSString, NSData). Missing attribute keys will assume a nil value.

For to-one relationships: the managed object ID of the related object or an instance of NSNull for nil relationship values. A missing key will be resolved lazily through calling newValueForRelationship:forObjectWithID:withContext:error: on the NSPersistentStore object. Lazy resolution for to-one relationships is discouraged.

For to-many relationships: an instance of NSArray or NSSet containing the managed object IDs of the related objects. Empty to-many relationships must be represented by an empty non-nil collection. A missing key will be resolved lazily through calling newValueForRelationship:forObjectWithID:withContext:error: on the NSPersistentStore object. Lazy resolution for to-many relationships is encouraged.

Unknown or unmodeled keys are stripped out.

version

The revision number of this state. This value is used for conflict detection and merging.

Import Statement

Availability

Declaration

Swift

var version: UInt64 { get }

Objective-C

@property(nonatomic,readonly)uint64_tversion

Discussion

The version number is used by the persistent store coordinator to detect and handle merge conflicts. The version number should be stored with the record. The version number should (implicitly) start at zero (where zero indicates an unsaved object in memory) and be incremented by exactly one every time you save. In addition, you increment the version number when you or the Core Data framework have marked the associated managed object for optimistic locking.