Re: Disabling Undo in Core Data
Re: Disabling Undo in Core Data
- Subject: Re: Disabling Undo in Core Data
- From: Jerry Krinock <email@hidden>
- Date: Sat, 1 Aug 2009 12:38:00 -0700
On 2009 Aug 01, at 05:11, Squ Aire wrote:
1) disableUndoRegistration ...
NSManagedObjectContextObjectsDidChangeNotification will stop being
sent when the context changes!
I'd call that a bug, at least in the documentation. It is implied in
a roundabout way...
"The notification is posted during processPendingChanges", and then if
you look up -processPendingChanges, "causes changes to registered
managed objects to be recorded with the undo manager."
But if it's true that
NSManagedObjectContextObjectsDidChangeNotification falls silent if
undo is disabled, at least the documentation should so state.
When I first started reading Core Data I thought that
NSManagedObjectContextObjectsDidChangeNotification would be quite a
useful and simpler "one stop" alternative to KVO, but then learned
that it is quite limited. You've just discovered another limitation.
2) Which brings me to the second option. Keep the undo stuff there
so that the NSManagedObjectContextObjectsDidChangeNotification will
properly be sent out, as I want. However, instead just get rid of
the Undo and Redo menu items.
I'd say it's quite reliable!
might be an option, but might be a bad one in case I would one day
like to add undoing for some selected feature in my app.
It is rarely a good decision in this business to not use an easy
solution because of what you "might" want to do "one day". The world
moves too fast.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden