Chapter 9. Nib Files and NSWindowController

In RaiseMan, you are already using two nib files: MainMenu.nib and MyDocument.nib. MainMenu.nib is automatically loaded by NSApplication when the application first launches. MyDocument.nib is automatically loaded each time an instance of MyDocument is created. In this section, you will learn how to load nib files using NSWindowController.

Why would you want to load a nib file? Most commonly, your application will have several windows (such as a find panel and a preferences panel) that are used only occasionally. By putting off loading the nib until the window is needed, your application will launch faster. Furthermore, if the user never needs the window, your program will use less memory.


In this ...

Get COCOA PROGRAMMING FOR MAC OS X SECOND EDITION now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.