• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
linking NSArrayController and Undo manager
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: linking NSArrayController and Undo manager
      • From: Ron Lue-Sang <email@hidden>
  • Prev by Date: Re: Avoiding mutual retain cycles
  • Next by Date: Re: Avoiding mutual retain cycles
  • Previous by thread: Re: Crash drawing shadows
  • Next by thread: Re: linking NSArrayController and Undo manager
  • Index(es):
    • Date
    • Thread