I have a main managed object context (MOC) in the UI thread which is usually updated by worker threads. Works fine!
However, I have one view where I create another MOC (called editingMOC) in the UI thread. I read myObject via objectID in editingMOC. Afterwards I do some modifications on the object myObject in the editingMOC. If the user hits cancel, the following happens:
[self.editingMOC reset];
myObjectEdit = [self.editingMOC existingObjectWithID:myObject.objectID error:NULL];
Shouldn't that restore myObjectEdit to it's state as it was before? I did not call save. Nevertheless myObjectEdit has still my changes. Any idea what might be wrong?
Thank you!
Update:
Apparently the refresh of myObjectEdit is correct (Thanks Mark Adams). I tracked it down to this weird behaivor:
// RESET VALUE - OK
NSLog(@"%@", myEditObject);
self.tableView.userInteractionEnabled = NO;
// OLD VALUE AGAIN - WRONG
NSLog(@"%@", myEditObject);
I haven't changed anything regarding to userInteractionEnabled. Does this method have any side effects not stated in the docs?