insert(_:)
Registers an object to be inserted in the context’s persistent store the next time changes are saved.
Declaration
func insert(_ object: NSManagedObject)Parameters
- object:
A managed object.
Discussion
The managed object (object) is registered in the receiver with a temporary global ID. It is assigned a permanent global ID when changes are committed. If the current transaction is rolled back (for example, if the receiver is sent a rollback() message) before a save operation, the object is unregistered from the receiver.