On Tue, Dec 7, 2010 at 5:14 PM, kvic...@pobox.com <kvic...@pobox.com> wrote: > i have a core data app that supports both real time events and user > interaction. some of the user interactions can generate an undo stack > similar to the following: > > beginUndoGroup > beginUndoGroup > core data action > core data action > endUndoGroup > myAction > endUndoGroup > > now some of the real time events can cause the target of myAction to be > deleted and i can easily remove this from the undo stack. but that leaves a > nested group which is no longer meaningful and it leaves the undo menu > action name referring to the deleted myAction > > is there anyway to delete the entire group (including the nested core data > actions)? if so, how? alternatively, can anyone suggest an approach to deal > with this situation?
Nope. Welcome to the wonderful world of undo! Where despite the promise of the API, the framework **really** doesn't like it when you call -[NSUndoManager removeAllActionsForTarget:]. Your delete should be undoable, right? So undoing the delete will make your undo group meaningful again. I hope. That's how it works for us in our non-Core Data apps, anyway. Hopefully Core Data is smart enough to be able to associate undo groups with resurrected managed objects. --Kyle Sluder _______________________________________________ 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