Closed jfield44 closed 10 years ago
Hm. This could be confusing. If you change values on the object, the changes are going to be recorded on its associated context. In other words, this wouldn't work:
Person *person = [Person find:@{@"firstName": @"Stephen"} inContext:moc1];
person.firstName = @"Steve";
[person saveInContext:moc2];
If you know which MOC needs saving, why not call [moc save:&error]
directly?
@jfield44 closing this, as it really doesn't make sense.
When you create an object in a managed object context, e.g. [Person createInContext:moc]
, the object knows it's context. So, person.managedObjectContext
would return moc
...with non standard ManagedObjectContexts
Hi I have added added another Save command called SaveInContext:(NSManagedObjectContext *)moc for use with Frameworks such as Restkit that specify a non standard MOC, this also helps in some cases where you have abstracted the initial fetch request.
Feel free to merge or ignore as desired :)