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

< Previous PageNext Page > Hide TOC

Legacy Documentclose button

Important: The Java API for Cocoa is deprecated in Mac OS X version 10.4 and later. You should use the Objective-C API instead. For a tutorial on using Cocoa with Objective-C, see Cocoa Application Tutorial.

Correct Build Errors

Of course, rare is the project that is flawless from the start. For most applications you write, Xcode is likely to catch some errors when you first build them. Thankfully, Xcode offers tools to help you catch those bugs and move on.

To get an idea of the error-checking features of Xcode, introduce a mistake into the code:

  1. Open ConverterController.java.

  2. Delete the semicolon after the selectText call in the convert method.

  3. Click the Build toolbar item.

Uh-oh! Something is amiss. You can now see that the left column of your code contains one error indicator.

While the error indicator helps you understand the location of the error, you may want to examine the nature of the problem. In the Groups & Files list, disclose the Errors and Warnings group if it’s not already disclosed. Xcode lists the files that contains build errors. In this case, the ConverterController.java file is the only file with a problem.

Select the file in the Errors and Warnings group to display the error. Xcode displays information about the error in the detail view, as shown in Figure 3-1.


Figure 3-1  Identifying build errors

Figure 3-1 Identifying build errors

Fix the error in the code and build the application again. The Errors and Warnings group clears and the status bar indicates that the build is successful.



< Previous PageNext Page > Hide TOC


Last updated: 2006-10-03




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