Apple Developer Connection
Advanced Search
Member Login Log In | Not a Member? Contact ADC

Interface Builder

Interface Builder is an application for designing and testing user interfaces. Developers can use Interface Builder to create user interfaces that follow the Mac OS X human-interface guidelines by dragging user-interface elements from a palette of predefined controls and dropping them into the window or view they are configuring. Interface Builder works closely with Xcode to provide a development experience that facilitates the concurrent but specialized development of an application's user interface and business logic.

Interface Builder is Apple's graphical editor for designing user interface components for both Carbon and Cocoa applications. Interface Builder makes creating an application's user interface easier by allowing developers to use its graphical editing environment to manage virtually every aspect of creating a well designed user interface that adheres to the Aqua user interface guidelines.

Interface Builder stores user interface resources in "nib" files. Nib files are a statically stored representation of the set of interface objects used by the application and their relationships which can be efficiently brought into memory when needed, reducing development time and making it easier to localize an application for different markets.

Developing with Interface Builder typically involves:

  • Creating a new Cocoa or Carbon nib file
  • Dragging in a new window, or edit a menubar
  • Dragging buttons, sliders, check boxes, etc. into the window and setting their attributes (Cocoa class, Carbon Command ID, etc.) in the Get Info panel
  • Cocoa developers can create new classes, actions, and outlets (instance variables), and then instantiate them in the nib file.
  • At any point, the developer can type Command-R to Run the interface in test mode. In "Test Interface" mode, you can click buttons, select menu items, drag windows, and generally exercise your UI. For Cocoa developers, this also allows the testing of connections and action message sending. For Carbon developers, this provides the ability to test Command Events within the scope of the UI.

After designing your UI in the nib, you can do one of two things. As a Cocoa developer, you can save out your new nib and object classes and have the files automatically inserted into your Xcode project. As a Carbon developer, you can save the nib and load components from it in your program using the API in IBCarbonRuntime.h.

Key Interface Builder Features

  • Helps you design Aqua-compliant user interfaces with the "Snap to Aqua Guidelines" feature
  • Creates both Cocoa nibs and Carbon nibs
  • Simplifies usage of CarbonEvents by allowing you to associate command/control IDs with your controls/menu items directly in Interface Builder
  • A key part of the Cocoa application development process - lets you subclass, connect objects, and establish default values, helping your application require less code
  • "Test Interface" mode lets you try your UI without writing any code
  • Spell Checks your UI text as you go