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

< Previous PageNext Page > Hide TOC

Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

The Xcode Editor Interface

When you edit a file in Xcode, you have the choice of using a standalone editor window or editing the file directly in any of the other Xcode windows, such as the project window, debugger window, build results window, and so forth. Regardless of your choice, Xcode uses a common interface for the editor. When you open a file in Xcode’s editor, you see a view similar to that in Figure 15-1.


Figure 15-1  The Xcode Editor

Figure 15-1 The Xcode Editor

Here’s what the Xcode editor contains:

  1. Gutter. The gutter displays file line numbers, as well as information about the location of breakpoints, errors, or warnings in the file. See “Displaying the Editor Gutter” to learn more about the contents of the gutter, as well as how to show and hide the gutter.

  2. Editor. The text editing pane displays the contents of the file.

  3. Navigation bar. The bar along the top of the editor contains several menus and buttons that let you quickly see, and jump to, locations within the current file and in other files open in the editor. “The Navigation Bar” describes the contents of the navigation bar and how to use it to navigate source code files.

Note:  You can also modify the attributes of the file reference associated with a file open in the editor, as described in “Inspecting File, Folder, and Framework References.”

In this section:

Editing Files in a Separate Editor Window
Using the Attached Editor
Splitting Code Editors


Editing Files in a Separate Editor Window

If you prefer, you can use a dedicated window for editing source files in Xcode. Regardless of your preference for whether Xcode automatically opens the attached editor in Xcode windows, you can always open a file in a separate editor by doing any of the following:

Figure 15-2 shows the Xcode editor in a separate window.


Figure 15-2  The Xcode editor in a standalone window

Figure 15-2 The Xcode editor in a standalone window

In addition to the basic editor interface, the standalone editor window also contains a toolbar and a status bar. The status bar is similar to the status bar of other Xcode windows, described in “The Project Window Status Bar.” Like the toolbar in other Xcode windows, the editor window toolbar provides easy access to common tasks. By default, it includes buttons to build, run, and debug the current target. It also contains the following two buttons:

To preserve the state of any open editor windows when you close a project, choose Xcode > Preferences, click General, and select “Save window state” in the Environment options.

Using the Attached Editor

You can also edit your source files from within other Xcode windows, such as the project window and the debugger window. To open a file in the attached editor, make sure that the editor is visible in the window. If the editor is not already visible, you can open it by clicking the Editor button or choosing View > Zoom Editor In. This opens the attached editor to its maximum size. If the editor was already at its maximum size, clicking the Editor button or choosing View > Zoom Editor Out returns the attached editor pane to its previous size. To adjust the size of the attached editor to a different size, drag the separator to the size that you prefer.

Selecting a file, an error or warning, a bookmark, a find result or a project symbol opens the associated file in the editor as long as the editor is visible. You can also have Xcode automatically show the attached editor when you select one of these items in the detail view. To specify that Xcode automatically open the attached editor, select “Automatically open/close attached editor” in the Editing options in the General pane of the Xcode Preferences window.


Figure 15-3  Editor in a project window

Figure 15-3 Editor in a project window

Splitting Code Editors

Xcode allows you to simultaneously view multiple files or multiple sections of the same file without increasing the number of open windows. It does this by splitting a code editor. The figure seen here shows an editor that has been split to display two parts of the same file.


Figure 15-4  Splitting a code editor

Figure 15-4 Splitting a code editor

Note that you can split an editor whether that editor appears in a separate window or as an attached editor.

To split a code editor, make sure that the editor has focus and do one of the following:

To close a split, choose View > Close Split View, or press the Close Split button. You can resize the panes of a split editor by dragging the resize control between them.



< Previous PageNext Page > Hide TOC


Last updated: 2006-11-07




Did this document help you?
Yes: Tell us what works for you.

It’s good, but: Report typos, inaccuracies, and so forth.

It wasn’t helpful: Tell us what would have helped.
Get information on Apple products.
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Copyright © 2007 Apple Inc.
All rights reserved. | Terms of use | Privacy Notice