Chapter 4. Development Tools

Apple has a powerful, integrated, cross-platform development environment for Cocoa on Mac OS X. It consists of a suite of applications and tools that deliver maximum productivity from the frameworks, subsystems, libraries, components, and other resources of Mac OS X.

In developing applications with Cocoa, you have a choice of programming languages. You can write programs, in whole or in part, in C, C++, Java, or Objective-C. You can subclass Cocoa classes in Java and mix “pure” Java and Cocoa objects in your code. Note that you cannot access the Cocoa APIs from C++.

In addition to the material provided in this chapter, you can find reference documentation covering the compiler, the debugger, and other tools located in /Developer/Documentation/DeveloperTools.

Project Builder

Project Builder is an application that manages software-development projects and orchestrates and streamlines the development process. Project Builder’s key features include:

  • A project browser

  • A full-featured code editor

  • Language-savvy symbol recognition

  • Sophisticated project search capabilities

  • Header file and documentation access

  • Built-in integration with the CVS source-control management system

  • Build customization

  • A graphical source-level debugger

Project Builder’s main window is shown in Figure 4.1.

The Project Builder main window

Figure 4-1. The Project Builder main window

Feature Highlights

When you write code with Project Builder you have a set of “workbench” tools at your disposal.

Delimiter checking

If you double-click a brace (left or right), the code between the braces (including the delimiters) is highlighted. Similarly, you can double-click a square bracket in a message expression to locate the matching bracket and double-click a parenthesis character to select the enclosing code. If there is no matching delimiter, Project Builder emits a warning beep.

Emacs key bindings

Emacs is a popular editor for writing code on Unix platforms. You can use the most common Emacs commands in Project Builder’s code editor. For example, there are the commands page forward (Control-V), word forward (Meta-F), delete word (Meta-D), kill forward (Control-K), and yank from kill ring (Control-Y). Some Emacs commands may conflict with some of the standard Macintosh key bindings. You can modify the key bindings Project Builder’s code editor uses to substitute other command keys—such as the Option key or Shift-Control—for Emacs’ Control or Meta keys. Option (Meta) key bindings are not enabled by default on Mac OS X because the Option key is used to generate special characters. Consult Project Builder’s documention for information on using these features.

Find

Project Builder gives you several ways to get information on Cocoa APIs when you’re developing an application.

  • The Find pane allows you to search for definitions of classes, methods, functions, constants, and other symbols in your project. Since it is based on project indexing, searching is quick and thorough and leads directly to the relevant code. Searches can also be textual or regular-expression based.

  • If the results of a search using Project Find include Cocoa symbols, you can easily get related reference documentation that describes that symbol by clicking on the book icon next to the result of interest.

  • You can browse the header files and documentation related to Cocoa frameworks within Project Builder. The Application Kit and Foundation frameworks always are included by default for Cocoa projects.

Flexible build system

Project Builder contains a very flexible build system, allowing you to build applications using either the application’s GUI or a command line. Project Builder facilitates the creation of different types of projects (such as palettes, frameworks, and bundles, in addition to applications). Consult Project Builder’s online help system—availiable from the Help menu—for additional information on using these features.

Get Learning Cocoa 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.