Xcode FAQ

General

Finding Documentation

Writing Code

Managing Projects

Building Products

Debugging Code

Contents:

General

How do I set my preferred project-window layout?

Xcode provides three ways of laying out your projects:

  • Default: This layout provides windows for each phase of your development process. You can arrange these windows to help you get specific information by glancing at particular locations in your screen.

  • Condensed: This layout provides a condensed Project window, which displays only the Groups & Files list arranged by files, targets, and other items.

  • All-in-one: This layout provides one window that displays the Project and Debugger pages. In the Project page you can display the Detail View and project find, SCM, and build results.

Finding Documentation

How do I search documentation?

The Documentation window is your portal into developer documentation. To search for documentation use the window’s search field. After entering a search term, the Documentation window provides three kinds of search results: API, Title, and Full-Text.

To open the Documentation window, choose Help > Documentation.

How do I view essential information about a symbol?

To view symbol information in a succinct manner, use Quick Help. You open Quick Help by selecting a symbol in the text editor and choosing Help > Quick Help.

How do I display symbol documentation?

While the cursor is on the symbol you’re interested in in the text editor, type choose Help > Quick Help (or type Option–double-click). This action opens Quick Help, displaying essential information about the symbol.

image: art/quick_help.pdf

For more information about Quick Help, see Using Quick Help.

How do I make Quick Help remain open?

After displaying Quick Help, drag it from its initial location. With that action Quick Help becomes an inspector, displaying help for the symbols you select as you move through your code.

Writing Code

How do I open the header file that defines a symbol?

Xcode provides two quick ways for opening the header file that defines a symbol:

  • While editing a source file. Select the symbol in the source file and type Option–double-click.

  • At any time. Choose File > Open Quickly and enter the symbol name in the search field.

How do I show or hide parameters in code completions?

In Code Sense preferences, you can specify whether arguments are shown in completion lists and in-line completions. For details, see .Code Sense Preferences

How do I move between visited locations within a file?

To move the cursor between file locations:

  • Choose View > Go Back or View > Go Forward.

  • Click the left or right triangle in the navigation bar.

How do I switch between opened files?

You can use menu commands or the navigation bar in the text editor to move between the files you’ve viewed in a particular editor view.

To move between opened files:

  • Choose View > Previous File or View > Next File (hold down Shift to reveal these commands).

  • Shift-click the left or right triangle in the navigation bar.

  • Choose a file from the file-history menu.

image: art/file_history.pdf

How do I set search options in Single-File Find?

The pop-up menu in the search field in the Single-File Find pane lets you specify search options.

image: art/file_find.pdf

Managing Projects

How do I check the correctness of my code?

To check the correctness of your code use static analysis at regular intervals or after making major changes. Static analysis uses rules, heuristics, and knowledge about system frameworks and proper API usage to detect problems in source code without actually executing it.

To perform static analysis on your code, choose Build > Build and Analyze.

How do I rename the product a target produces?

To change the name of the product a target produces (an application, framework, plug-in, and so on), change the value of the Product Name build setting:

  1. In the Targets group of the Groups & Files list, double-click the target in question.

  2. In the Target Info window, click Build.

  3. From the Configuration pop-up menu, choose All Configurations.

  4. From the Show pop-up menu, choose Settings Defined at This Level.

  5. Set the value of the Product Name build setting, in the Packaging group, to the new product name.

For more information, see Editing Build Settings.

How do I rename a project?

To rename a project, choose Project > Rename.

Building Products

How do I tell Xcode where to find external headers, libraries, and frameworks?

Xcode uses search paths to find headers, libraries, and frameworks used in your project. If you use third-party libraries in nonstandard locations, you need to add those locations to the search paths. These build settings specify search paths:

  • Header Search Paths

  • Library Search Paths

  • Framework Search Paths

For more information, see Search Paths.

Debugging Code

How do I debug an application without its original project?

You can use the debugger to debug an application for which you don’t have the project that created it. To do so, you create a project with a custom executable environment to use as your debugging platform.

To debug an application without its originating project:

  1. In Xcode, choose File > New Project. Specify a name and a location for the project.

  2. Choose Project > New Custom Executable. Name the executable after the name of the application you want to debug and choose the binary.

  3. In the Executables group of the Groups & Files list, select the newly created executable environment.

  4. Choose Run > Debug to debug the application.

If you want to use breakpoints and you have the application’s source code available, there are two ways to identify the sources: