Chapter 3. Creating a Simple Application with Interface Builder

Interface Builder is Cocoa’s main development tool for creating user interfaces for your applications. It lets you graphically design the windows that your application will use, together with all of their associated menus, buttons, sliders, and other objects. After you’ve put together the basic interface for your application, IB lets you “wire” (connect) together the parts (objects) and save all these specifications so that your application can use them when it runs.

This chapter introduces you to IB. We’ll build a very simple interface for an application and test it with IB’s Test Interface command. We won’t use this interface beyond this chapter; we won’t even save it. Our only goal here is to give you a sense of the ease and power of IB.

Let’s start by taking a look at a typical Cocoa developer’s screen, shown in Figure 3-1. The application being built is a simple calculator, and the IB development tool is the active application. The window at the top left that looks like a calculator is the interface for the calculator application under development. Similarly, the small window below the calculator window is the menu interface for the calculator application. The window at the bottom left and the two windows near the Dock are IB development support windows (and therefore aren’t part of the calculator application itself ). In the center of the screen is a Project Builder window containing source code for the calculator ...

Get Building Cocoa Applications: A Step by Step Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.