Chapter 3. Using Xcode

 

This chapter covers

  • Learning how Xcode works
  • Writing a simple Hello, World! program for the iPhone
  • Writing a simple Hello, World! program for the iPad
  • Creating new classes

Now that you’ve learned a bit about the puzzle pieces needed to build an SDK program, you’re ready to start programming. The main purpose of this chapter is to show you how Xcode, the SDK’s main development environment, works. Via a traditional Hello, World! program, we look at the parts of a standard SDK program. You’ll build it first for the iPhone and then build it again for the iPad so you can see how to construct a basic application for either device. We also examine how to create new classes of objects; and with that under your belt, we finish up by looking at some of Xcode’s most interesting features.

3.1. Introducing Xcode

Apple programming begins with Xcode, an integrated development environment (IDE) that you can call up from the Developer directory. To write iPhone or iPad programs, you must have downloaded the iPhone SDK, as discussed in the previous chapter. After you’ve done that, choosing File > New Project gets you started. You’re immediately asked to select a template for your new project.

3.2. Creating a first iPhone project in Xcode: Hello, World!

3.3. Creating a first iPad project in Xcode: Hello, World!

3.4. Creating a new class in Xcode

3.5. Other Xcode functionality

3.6. Summary