Monday, November 16, 2009

NSDocumentController - Reusing a single window across multiple documents

A further twist to having a single document visible at any one time is that I would like to keep a single window and reuse it. The way I have done this is as follows
  • When I get the NSApplicationWillFinishLaunchingNotification I create the window controller and window. I do this by reading in a nib file that has my subclass of a window controller and a window.
  • In the makeWindowControllers method of my document subclass I call addWindowController to add my global window controller.
And that is about it.

No comments: