Re: CoreData "Could Not Merge Changes"
Re: CoreData "Could Not Merge Changes"
- Subject: Re: CoreData "Could Not Merge Changes"
- From: Jesse Grosjean <email@hidden>
- Date: Mon, 15 Aug 2005 09:47:16 -0400
Making several assumptions, you can sort of work around it using -
rollback, but I haven't worked through this properly yet (notably the
final segment of the attemptRecoveryFromError method) -- and I really
must get to sleep at some point...
Yes first get some rest, and thanks for all the help on this list.
I've found that saving immediately after each undo/redo operation
seems to fix the problem. I do it by adding these lines to my
documents init method:
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(saveDocument:)
name:NSUndoManagerDidUndoChangeNotification object:[[self
managedObjectContext] undoManager]];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(saveDocument:)
name:NSUndoManagerDidRedoChangeNotification object:[[self
managedObjectContext] undoManager]];
This works OK for my application because I always handle saving, not
the user. But of course it would create problems in a normal document
based application where the user is in charge of saving. Plus it's a
bit of a performance problem, but that's better then breaking.
Jesse
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden