Monday, February 19, 2007

Seeing Xcode's Build Errors

When you build an Xcode project, Xcode tells you whether or not the build succeeded. If the build succeeded, that's all you need to know, but if the build failed, you want to know what the errors are so you can fix them. Xcode has two places to look at your errors: the Errors and Warnings smart group and the build results window.

Errors and Warnings Smart Group

In the project window's Groups and Files list, you will see the Errors and Warnings smart group. Select the Error and Warnings group and the project window shows the build errors. Double-clicking an error or warning takes you to the line of code where the error occurred.

Build Results Window

When you need to see more detailed information about your build, use the build results window. Choose Build > Build Results to open the build results window. The build results window has three sections. The top section is the build results, which shows the high-level build steps. The middle section is the build transcript, which shows the low-level steps Xcode takes to build your project. The bottom section is the editor. Selecting an error from the build results or the build transcript shows the line of code in the editor where the error occurred.

Showing the Build Transcript

If you open the build results window for the first time, you won't see the build transcript. The build transcript is initially invisible, and you must tell Xcode to show it. Below the build results are four small buttons. Click the third button to show the build transcript.