Re: another Core Data and Undo Question
Re: another Core Data and Undo Question
- Subject: Re: another Core Data and Undo Question
- From: Kyle Sluder <email@hidden>
- Date: Tue, 7 Dec 2010 23:30:46 -0800
On Tue, Dec 7, 2010 at 5:14 PM, email@hidden <email@hidden> 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 (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