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.
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:
Open ConverterController.java.
Delete the semicolon after the selectText call in the convert method.
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.
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.
Last updated: 2006-10-03