Opening and Adding Files
To view and edit a source file, select it in the project navigator. The file’s contents appear in the editor area of the workspace window.
Creating Source Files from Templates
Use file templates to add files to your project with minimum effort. To access the File Template library, click the File Template button () in the utilities area of the workspace window. Create a source file by dragging its template to the project navigator.
Alternatively, choose File > New File or press Command-N. Xcode brings up the New File dialog, where you can choose a template for your file. After choosing a template and pressing Next, you name the file and add it to your project.
Opening a File Quickly
Choose File > Open Quickly to locate files that define a specified symbol or whose filenames contain a specified string. Open Quickly searches are case insensitive and are limited to the current project and to the active software development kit (SDK). From the search results list, double-click the file you want to open.
To open the file in the assistant editor pane, hold down the Option key when you double-click. To open the file in a separate window, press Option-Shift. To see a dialog letting you specify where the file should open, press Option-Shift-click.
Splitting the Editor to Display Related Content
Split the editor pane to see multiple views of the same file or to view multiple related files at once. For example, you can simultaneously view an implementation file and its header file counterpart. To split the source editor, open an assistant editor pane by clicking the Assistant Editor button () in the workspace toolbar. The split can be vertical or horizontal.
To change the orientation of the split, choose View > Assistant Editor, and then choose one of the menu options. In both of the screenshots above, the navigator and utilities areas are closed to maximize the viewing area of the source editor.
Setting the Assistant Editor Mode
When you open an assistant editor pane, you can set it to either of two modes: manual or tracking. In manual mode, you select the file to display by navigating to it in the jump bar. The contents of the assistant editor do not change as you change the contents of the main editor.
In tracking mode, you select a criterion from a pop-up menu. Criteria include include groupings such as counterparts, superclasses, subclasses, and siblings. Once you choose a criterion, Xcode lists the appropriate files in a submenu. As you change the file in the main editor, Xcode updates the assistant editor based on the selected criterion.
To change the mode, select one from the Assistant pop-up menu. (The Assistant pop-up menu is the first item to the right of the back and forward arrows in the assistant editor jump bar.)
You can further split the assistant editor pane by clicking the Add button () in the top-right corner of the assistant editor pane. The nearby close button () closes it again.