CoreData Undo in Modal Dialog
CoreData Undo in Modal Dialog
- Subject: CoreData Undo in Modal Dialog
- From: Keith Wilson <email@hidden>
- Date: Thu, 28 Sep 2006 23:54:01 +1000
I have a Document based Core Data application using SQLite. The
database is reasonably complex and the main window is busy. It is
horizontally split with a diagram in the top half of the window and a
tabView (12 tabs) in the bottom half. The tabViews contain
TableViews, OutlineViews, TextFiellds, TextViews, Buttons, etc.
There are lots of ArrayControllers and bindings. Works fine. Undo/
Redo works fine.
The user can invoke a application modal window that contains more
controls and more bindings to the same managedObjectContext.
In the modal window I want the user to be able to Undo All but do not
really need Redo.
When the user has invoked the modal window then [[moc undoManager]
undo] should undo back to when the modal dialog was invoked, never
earlier.
I do not want to invoke [[moc undoManager] removeAllActions] to clear
the the undo stack when the modal dialog is initialised. This works
but ...
I have tried invoking [[moc undoManager] beginUndoGrouping] during
the init of the modal dialog but it gets confused - the confusion
seems to depend on whether an undo group already exists for the
current run loop. I have tried selectively beginnig a new undoGrouing
based on current groupingLevel but that didn't work either.
So the question is:
When I invoke a modal dialog how should I use the
ManagedObjectContext undoManager while amodal dialog is active so it
cannot not undo changes that were made prior the initialisation of
the modal dialog.
Keith
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden