• 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
Re: Best Practice for implementing NSUndoManager?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Best Practice for implementing NSUndoManager?


  • Subject: Re: Best Practice for implementing NSUndoManager?
  • From: Sean Todd <email@hidden>
  • Date: Tue, 8 Jun 2004 08:38:26 -0500

Luke,

The link to your sample app didn't work for me so I will just give you my thoughts on the 2 questions that you posed (in so far as I understand what you wrote):

1) Should the model or the controller add objects to the undo
manager?

Considering 'reuse' issues, I would say that the model should not have any knowledge of an undo manager and would opt for the controller.

2) If I am on the right track with question 1, then question 2 is:
How should you propagate the NSUndoManager within the app? At present
I am passing the NSUndoManager to objects during the initialization
of the object, is there an easier or more elegant way to do this?


For this, you could try something like:

[[[NSDocumentController sharedDocumentController] currentDocument] undoManager];


Sean
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: Best Practice for implementing NSUndoManager?
      • From: Raphael Sebbe <email@hidden>
    • Re: Best Practice for implementing NSUndoManager?
      • From: Luke Tupper <email@hidden>
  • Prev by Date: How to quit
  • Next by Date: Re: Checksums and best way to get'em
  • Previous by thread: Best Practice for implementing NSUndoManager?
  • Next by thread: Re: Best Practice for implementing NSUndoManager?
  • Index(es):
    • Date
    • Thread