Interface Builder Services Concepts

Interface Builder Services provides functions that unarchive interface objects from nib files. A nib file is an Interface Builder file; it contains a description of one or more objects in a user interface. Before you use the functions in Interface Builder Services, you may find it helpful to know a bit more about Interface Builder, nib files, and strategies for storing interface objects.

Interface Builder

Interface Builder is an Apple development tool you can use to build interfaces for your Carbon applications. It is a WYSIWYG tool that lets you lay out user interfaces in a simple, intuitive manner. You use it along with Project Builder, Apple’s main development tool. Interface Builder and Project Builder are available on the Mac OS X Developer CD.

You can find more information about using Interface Builder in the online help provided with it.

Nib Files

A nib file contains the application’s interface-based resources. It’s an Interface Builder file (the “ib” in “nib” stands for Interface Builder) that contains descriptions of the interface elements in your application. These descriptions use XML (extended markup language), although you’ll never see, nor should you try to edit, the XML in a nib file. A nib file can contain user-interface objects, and references to any sounds, and images used in the interface.

A nib file can describe all or part of a user interface. Most applications use two or more nib files, with one of them designated as the main nib file. The main nib file contains the main menu and any windows and panels you want to appear when your application starts up. In addition to the main nib file, you can have one or more nib files that you load whenever you need them. The additional nib files are called auxiliary nib files. For example, if your application is a word processor, you might have an auxiliary nib file for a document window. Each time your user creates a new document, you’d use Interface Builder Services to unarchive a document window from the auxiliary nib file.

Strategies for Storing Interface Objects

You can strategically store an application’s interface objects in several nib files. When the application needs an interface object, you can load the nib file which contains it. You’ll conserve memory and improve program efficiency by following these guidelines: