• 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: UndoManager
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: UndoManager


  • Subject: Re: UndoManager
  • From: Dustin Voss <email@hidden>
  • Date: Sun, 17 Nov 2002 22:25:38 -0800

On Thursday, November 14, 2002, at 03:45 AM, Craig Bakalian wrote:

Hi,
Still coding away at my music notation app. I was just about finished
the Data Model Classes when bam!, I realized I need redo and undo in
the app. I went for a walk through the SKTDrawDocument in the
Sketch.app. I think I understand how to register the selector and
object with the NSUndoManager, yet in the Sketch.app I see this-

- (void)insertGraphic:(SKTGraphic *)graphic atIndex:(unsigned)index {
[[[self undoManager] prepareWithInvocationTarget:self]
removeGraphicAtIndex:index];
[_graphics insertObject:graphic atIndex:index];
[graphic setDocument:self];
[self invalidateGraphic:graphic];
}

This brings up many questions in my average IQ type head, firstly I
can't find the instance or function definition of undoManager that
[self undoManager] , so is this an inherited method? I am assuming that
[self undoManager] is a getter. I mean, it has to be. So, were is the
get, in NSDocument?

It is actually declared in NSResponder. NSDocument and NSWindow both override NSResponder's implementation to return an NSUndoManager, but NSWindow checks its delegate first, which (in a document window) will be NSWindowController, and NSWindowController will check with its NSDocument instance.

(Disclaimer: This is from memory, so I may be wrong.)
_______________________________________________
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.

References: 
 >UndoManager (From: Craig Bakalian <email@hidden>)

  • Prev by Date: Re: MAC Address of machine.
  • Next by Date: Re: dylibs in bundle?
  • Previous by thread: Re: UndoManager
  • Next by thread: RE: UndoManager
  • Index(es):
    • Date
    • Thread