O'Reilly logo

Learning Cocoa by Apple Computer Inc

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

Create Graphical User Interfaces in Cocoa

In this section you’ll see how Cocoa and Interface Builder combine to simplify and accelerate the process of constructing applications with a graphical user interface. You’ll learn about:

  • Windows. A window is an area on the screen (usually, but not always, rectangular) in which an application displays things such as controls, fields, text, and graphics.

  • Nib files. Nib files are files created by Interface Builder that contain windows as well as other user interface objects.

  • Outlets. Outlets are special instance variables created by Interface Builder that allow objects to send messages to one another.

Finally, you’ll apply what you’ve learned by creating a Cocoa application that displays a window with a single text field containing the current date and time.

Windows in Cocoa

A window in Cocoa looks very similar to windows in other user environments such as Microsoft Windows or Mac OS 9. A window can be moved around the screen, and windows can be stacked on top of one another like pieces of paper. A typical Cocoa window has a titlebar, a content area, and several control objects.

NSWindow and the window server

Many user interface objects other than the standard window are windows. Menus, pop-up menus, and scrolling lists are primarily windows, as are dialog boxes, alerts, Info windows, and tool palettes, to name a few. In fact, anything drawn on the screen must appear in a window. End users, however, may not recognize or refer to them as ...

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