Like CodeWarrior, Xcode is focused on the use of projects, targets, and files. But it also takes advantage of some of the popular user interface features found in iTunes and other Apple consumer applications, such as useful grouping of files and other items, fast searching for items, and a clean, relatively simple interface.
The development environments for Xcode and CodeWarrior contain the same major components, including project window, text editor, build system, debugger, symbol navigation, find facilities, and help system. One significant difference is that Xcode includes a number of open source components, including the GCC compiler and GDB debugger, as well as other tools written by the UNIX open-source community.
Behind the user interface, Xcode performs many tasks by launching command-line tools as Mach processes. That allows Xcode to implement features such as distributed and multiprocessor builds, where each GCC compile can be handled by a separate CPU, even on separate machines.
Some Special Features of Xcode
The Project Window
Customizing the Environment
Xcode supports several features with no exact equivalent in CodeWarrior, and others that put a new twist on everyday features. For details on how to use these features, as well as possible limitations, see Xcode User Guide.
Making life easier for many common tasks:
Fast searching allows you to quickly find a file, symbol, warning, error, or other item in a list by filtering out any items that don’t match the characters you type. You can search using string matching, regular expressions, or wildcard patterns.
Smart groups let you intelligently organize your project’s content and data, using groups that match a certain rule or pattern. For example, built-in smart groups include the Errors and Warnings group and the Find Results group.
Inspectors allow you to examine and edit the objects in your project.
Integrated Mac OS X API documentation provides full access to all installed Mac OS X documentation, with rapid API searching by language. It includes many searching and viewing options to help find the programming information you need. Automatic detection of documentation updates lets you download the latest technical information from Apple.
For improving your building and debugging experience:
Distributed builds can dramatically reduce build time for large projects by distributing compiles to available computers on the network.
ZeroLink shortens link time for development builds and allows you to very quickly relaunch your application after making changes.
Fix and Continue improves your debugging efficiency by allowing you to change the source in a file, recompile just that file, and run the changed code without stopping the current debugging session. (The Fix icon looks like a tape dispenser.)
Figure 1-1 shows the Xcode project window for a simple Carbon application.
You can get a complete listing of Xcode features in Xcode User Guide, but the following list highlights some of the most frequently used interface features.
Instead of tabs (as in CodeWarrior and Project Builder), the default project window in Xcode uses a hierarchical list of groups in the Groups & Files list. Xcode includes several different project window layouts, however, including one that provides a tabbed interface to your project's contents.
The contents of the selected item or items in the Groups & Files list are listed in a detail view.
Text you type in the Search field is used to filter items in the detail view. The Search field supports simple string matching, regular expressions, and wildcard patterns.
For source files, the detail view shows build status, SCM status, size, errors, warnings, and so on.
Some of the items that can appear in the Groups & Files list include:
The project group, at the top of the Groups & Files list, shows all of the files, frameworks, and libraries included in the project. The previous figure shows the project group "CarbonTest."
Source groups, identified by yellow folder icons, can contain other source groups. They help you organize the files in your project into more manageable chunks.
The Targets group contains all the targets in the project.
The Executables group contains all of the executable environments defined in the project. Executable environments specify the executable file that is launched when you run or debug; typically, this corresponds to a product that the project builds.
The following items in the Groups & Files list are smart groups:
The Errors and Warnings group lists the errors and warnings generated when you build your project.
The SCM group lets you view the project files currently under version control, as well as their current state.
The Bookmarks group contains all of the locations you have saved as bookmarks for this project.
The Find Results group contains the results of any searches you perform in your project. Each search creates a new entry in this group.
The Project Symbols group lists all of the symbols defined in your project.
The NIB Files group contains any .nib files used to create your product's user interface.
The Implementation Files group contains all of the implementation files in your project, such as those ending in .cpp , .c , and .m .
You can define your own smart groups and the rules for what they contain. User-defined smart groups are indicated with a purple folder icon.
Inspector windows and Info windows handle much of the interesting work, allowing you to easily display and edit project data. (These windows differ in that inspector windows are floating utility windows that track the current selection, while Info windows are standard windows that continue to display information about the same item.)
Among other things, you can use these windows to:
display per-project settings
display per-target settings
Figure 1-2 shows the target inspector. A useful feature of the build settings interface is a section below the build settings table that provides a description of the currently selected build setting. If this section isn’t visible, you can display it by dragging the separator bar.
display per-file settings and information, such as location, encoding, tab settings, line endings, and so on
select multiple project items—such as files or targets—and change settings on all of them (for settings for which this makes sense)
The Find string is persistent across dialogs (and even many Mac OS applications).
Xcode uses shell paths (slash-delimited) exclusively, not colon-delimited paths.
Xcode supports per-file compiler settings.
The Xcode editor supports code completion; as you type identifiers and keywords, Xcode suggests likely matches based on the current context.
If your fingers are hard-wired for CodeWarrior keystroke equivalents (or BBEdit, or even MPW), don’t worry. Xcode provides many features you can customize to fit the way you like to work. These include all the standard features you can set up in the Xcode Preferences window, such as indentation style, syntax coloring, Source Code Management (SCM) options, and so on.
Xcode provides additional control over your environment with the following features:
You can customize Command-key equivalents for menu items, as well as keystroke equivalents for editing tasks, to use the keystrokes you are most familiar with. Xcode provides predefined sets that are compatible with BBEdit, CodeWarrior, and even MPW (Macintosh Programmer’s Workshop, the Apple development environment for Mac OS 9). To learn more about customizing keystroke equivalents, see Customizing Key Equivalents in Xcode User Guide.
You can select from a number of different project window layouts, to choose the configuration that works best for you. These layouts are:
Condensed. This layout provides a project window that contains tabs for Files, Targets, and all other smart groups. You use separate windows for tasks other than project navigation. This layout should be the most familiar to CodeWarrior users.
All-In-One. This layout provides a single window for all of the tasks typical of software development, such as debugging, viewing build results, and searching.
Default. This layout provides the default Xcode project window, described in “The Project Window.”
For more on project window layouts, see The Project Window in Xcode User Guide.
You can choose what information Xcode displays in the project window, by customizing the set of smart groups that appear there. You can rearrange, show, and hide any of the groups that appear in the project window.
You can choose the editors to use for files in your project. You can use the Xcode editor or use an external editor such as BBEdit or Emacs. Or you can choose to open a file with the application chosen for it by the Finder.
You can easily customize the toolbar for any project window, adding or removing items, or choosing the default set.
You can conveniently use shell scripts in Xcode in several ways:
For details on how to customize, see Customizing Xcode in Xcode User Guide.
Last updated: 2006-10-26