Getting Started
So, where to start? In my case, the first stop was [login to view URL] where I quickly zeroed in on a highly-rated book entitled Beginning iPhone Development. I couldn't wait for Amazon, so I braved the Christmas shopping crowds and found the book in stock at a local tech-bookstore. They only had two copies left and the proprietor said it was selling well, so maybe I wasn't the only one with this idea.
When I got home, I headed off to Apple's developer web site to sign up and download the development kit . If you want to use it yourself, you'll need a relatively recent X86-based Mac. The free kit includes a complete fully-functional iPhone simulator (Figure 1) where you can try your application out.
Figure 1: iPhone Simulator
To actually install your project on an iPod or an iPhone, you'll need to take the next step up the developer program ladder and pay $100. This will get you additional documentation, technical support, tutorials, encryption keys, and most importantly the ability to sell your application in the iTunes Application store. For myself, I wasn't sure how far I'd get. So to save my money, I initially made do with the simulator.
The main part of the development kit that you'll be interacting with is the Xcode IDE. That's where you'll to do all of your editing, compilation, profiling, user interface work, etc. Figure 2 shows the layout of a basic iPhone application inside the IDE.
Figure 2: Xcode IDE
In this window, you can see a list of the various files and directories in the project, along with the editing window where you'll spend a lot of time. I had never used Xcode, so it was a bit of a learning-curve to figure it all out. But the book and included project templates enabled me to get up and going quickly with a little "hello-world" application running inside the simulator.
In fact, you can get a basic iPhone application running with buttons, labels, images, etc. without writing a single line of code. Apple includes project templates for a number of different application types and given my short timeframe, my strategy was to start with an OpenGL-based template and modify it for my needs.
When setting up menus, buttons, forms, etc. for your application, you'll use Apple's Interface Builder (IB). Figure 3 shows the widget library from IB.
Figure 3: Interface Builder Widget Library
The basic idea is that you drag items from the library onto your application's window where you can arrange, group and customize then them as needed. Once you get everything set up, you'll use IB to link actions such press, scroll, etc. to your own code.
And speaking of code, all of the code in the template files is written in Objective C, and as mentioned earlier, I had never written a line of Objective C. Fortunately, Objective C is a superset of C. So in the interest of time, I intended to write most of my own code in C and only use Objective C where I needed to do user interaction.
Initially I didn't need much user interaction. I just wanted to set up a blank OpenGL canvas that would open when my application started. And the Open GL template provided by Apple took care of this for me. So with little work, I had my own application that I could start up on the simulator with a basic OpenGL canvas for me to draw to. Now would be he hard part. Creating the code to bring my idea to life.