Creates and returns a new object of the appropriate class.
- macOS 10.3+
A new object of the appropriate class. The returned object is implicitly retained, the sender is responsible for releasing it (with either release or autorelease).
If an entity name is set (see
entity), the object created is an instance of the class specified for that entity (and the object is inserted into the receiver's managed object context). Otherwise the object created is an instance of the class returned by
This method is called when adding and inserting objects if
The default implementation assumes the class returned by
object has a standard
init method without arguments. If the object class being controlled is
NSManaged (or a subclass thereof) its designated initializer (
init(entity:) is called instead, using the entity and managed object context specified for the receiver.