iPhone Game Development - Chris Craft [16]
But before you start coding, you need to be sure that your development environment is set up correctly. This is similar to a pilot performing a preflight check of the plane before takeoff. Things can go wrong in the air, but you will minimize them if you confirm everything is correct before you leave the ground.
You will need to download and install all the necessary iPhone SDK tools. Following this you will then download and run one of the example applications provided in the iPhone SDK tutorials. The example will verify your environment and whet your appetite. Finally, you will be ready to write your first application from scratch, and as a bonus you will become oriented with the tools and processes that will become your friends as you move forward.
Setting Up Your Environment
As we've mentioned, it's important to make sure that your development environment is up and running before you begin writing code. If this is the first time you have installed the iPhone SDK, you should have no problems. If you have tried to install it before, you may need to follow a few more steps to ensure that you get started properly. Once you get the SDK installed, you will need to be sure everything you need is installed properly. The best way to test things out is to fire off some code and watch it run. We know you want to get started, but when you start trying to track down errors, you will find it frustrating to pinpoint the issue if your environment or setup is contributing to the problems you are experiencing.
Getting the iPhone SDK
This section will guide you through the process of downloading and installing the tools you will need in order to develop applications for the iPhone. The tools you need can be found at iPhone Dev Center, so start by going to http://developerapplecom/iphone.
Registering for the tools
If this is your first time visiting iPhone Dev Center, you will need to register to be able to download the iPhone SDK. Once at iPhone Dev Center, look in the right column right below the login button and you will see a Not a Registered iPhone Developer? section. Click the Start Now link. You will be guided through a simple wizard, and shortly you will have a valid Apple ID with which to log in. This process is free and painless, but it does not allow you to publish your applications to the App Store or even install and test on your device. In order to do these things you will need to apply for the iPhone Developer Program. The Developer Program membership is $99 as of this writing. Once you're a member of the program you can create and debug applications on your device. You will also have a license to distribute your creations on the App Store. To get started in the iPhone Developer Program, go to http://developerapplecom/programand click Learn More for the next page, where you can click Apply Now to get started. Unfortunately, this is not an instant process and it may take several weeks for your application to get approved. However, you can continue to develop on the iPhone Simulator with a large amount of success until you are approved.
Cross-Reference
Learn more about the iPhone Developer Program in Chapter 1.
Downloading the tools
Once you have your Apple ID you can begin downloading the tools. If you are waiting on approval for the iPhone Developer Program, you can still download the SDK and get started. Tune your browser back to the iPhone Dev Center, http://developerapplecom/iphone, and log in with your Apple ID. Scroll down to the iPhone OS 3.0 Downloads section. Once there, your screen should look similar to Figure 2.1.
FIGURE 2.1
The Downloads section of the iPhone Dev Center is where you go to download the iPhone SDK.
This section changes its form from time to time depending on which version of the OS is currently available. If a version of the OS is available to download that is not currently published for public use, you will have an option to download the latest usually non-released beta version of the iPhone SDK