linking NSArrayController and Undo manager
linking NSArrayController and Undo manager
- Subject: linking NSArrayController and Undo manager
- From: Todd Heberlein <email@hidden>
- Date: Mon, 21 Jul 2008 20:52:47 -0700
Is there a way to link a controller (e.g., the NSArrayController) to
my NSDocument's NSUndoManager without having to add a bunch of code to
my NSDocument subclass?
For example, in Hillegass's book, the first example of RaiseMan (Chap
8) has a nice clean design that lets the NSArrayController manage all
interactions between the table view and the NSArray model.
But when adding the undo/redo capability (Chap 9) you have to add a
lot of code to MyDocument to intercept and register with the
NSUndoManager all insertion/deletion and edits to the model. This
seems inelegant.
It would be nice to register MyDocument's NSUndoManager with the
NSArrayController so that the NSArrayController can handle all the
undo and redos.
Is it possible to do this?
Thanks,
Todd
_______________________________________________
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