NSUndoManager - grouping undo actions in Core Data
NSUndoManager - grouping undo actions in Core Data
- Subject: NSUndoManager - grouping undo actions in Core Data
- From: Dave Fernandes <email@hidden>
- Date: Wed, 25 Apr 2007 17:54:43 -0400
I am having trouble getting the desired behavior for undoing actions
in a CD app. My immediate problem is that I would like to group some
actions across events.
I tried [undoManager beginUndoGrouping] with a matching [undoManager
endUndoGrouping], but I get a crash when undoing. The app was quite
stable without grouping the actions.
I then tried calling
[undoManager beginUndoGrouping];
[undoManager setGroupsByEvent:NO];
- it must be done in this order, or no undo group gets created
I then call [undoManager endUndoGrouping] after the last update to my
managed objects... Now everything works like I would like as far as
grouping actions.
The problem is that I am unable to successfully re-enable grouping by
event. I call [undoManager setGroupsByEvent:YES], and then
[undoManager groupsByEvent] returns YES. But when I try to update
another managed object without manually creating an undo group, I get
an exception that "NSUndoManager is in an invalid state, must begin a
group before registering undo"
So how can I re-enable grouping by event? Or how can I group actions
without first disabling grouping by event?
Dave
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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