For example, if I have an NSManagedObject
named Items
, and I want to set the ManagedObjectContext
later (not when initialised), how wo
The standard init method for an NSManagedObject
subclass is -initWithEntity:insertIntoManagedObjectContext:
. If you don't provide a context, call:
[myManagedObjectContext insertObject:item];
...which is what the init method does internally. You'll still need to save the managedObjectContext as usual.