O'Reilly logo

Cocoa Programming for Mac OS X, Third Edition by Aaron Hillegass

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 12. 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 by 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 postponing loading the nib until the window is needed, your application will launch more quickly. Furthermore, if the user never needs the window, your program will use less memory.

NSPanel ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required