init(objectID:withValues:version:)
Returns an object initialized with the given values.
Declaration
init(objectID: NSManagedObjectID, withValues values: [String : Any], version: UInt64)Parameters
- objectID:
A managed object ID.
- values:
A dictionary containing the values persisted in an external store with keys corresponding to the names of the property description in the
NSEntityDescriptionobject described byobjectID: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
NSNullfor nil relationship values. A missing key will be resolved lazily through callingnewValueForRelationship:forObjectWithID:withContext:error:on theNSPersistentStoreobject. Lazy resolution for to-one relationships is discouraged.For to-many relationships: an instance of
NSArrayorNSSetcontaining 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 callingnewValueForRelationship:forObjectWithID:withContext:error:on theNSPersistentStoreobject. 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.
Return Value
An object initialized with the given values.
See Also
Related Documentation
- Incremental Store Programming Guide