In fact, the   NSManagedObjectContextObjectsDidChangeNotification   is working 
nicely for my purposes, given that it is indeed being sent!



So, solution 2) you seem to like. When I said "one day" I actually meant to say 
that I plan on supporting undo for some selected features in my app, especially 
if my users request them. So it's not something "far in the future" thing.



So how about this: a) Leave the Core Data undo manager running (so that the 
NSManagedObjectContextObjectsDidChangeNotification will be sent properly). b) 
Get rid of the Undo and Redo menu items. c) When I need undo/redo for a 
particular feature, just add the Undo and Redo menu items again but connect 
them not to the default stuff but my own thing--my own custom undo manager 
stuff.



Sounds good enough?



----------------------------------------
> From: je...@ieee.org
> To: cocoa-dev@lists.apple.com
> Date: Sat, 1 Aug 2009 12:38:00 -0700
> Subject: Re: Disabling Undo in Core Data
>
>
> 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 (Cocoa-dev@lists.apple.com)
>
> 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:
> http://lists.apple.com/mailman/options/cocoa-dev/squ4r3%40live.com
>
> This email sent to squ...@live.com

_________________________________________________________________
Share your memories online with anyone you want.
http://www.microsoft.com/middleeast/windows/windowslive/products/photos-share.aspx?tab=1_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to