So you want to write an iPhone app (3)

In my last post in this series, I promised to spend a day or two reading the iPhone developer’s getting started documents and then report back on what I’d learned. In typical fashion, it’s taken me more like 4 days. Not because it’s difficult – it’s just that I’m incredibly lazy. So without further ado, here are some things I’ve learned:

  • iPhone OS Overview – This document summarizes the various layers in the iPhone. The iPhone kernel is a variation of the same OS X kernel (derived from Mach) running in the Mac. Of the four layers described (core OS, core services, Media, and Cocoa Touch) the former is the one on which you’ll want to focus your attention. More specifically, there are two programming frameworks in the Cocoa Touch layer that serve as the most important API’s in your application: “foundation” and “UIkit”.
  • Tools for iPhone OS Development- This document summarizes three key developer tools: Xcode, which is the Integrated Development Environment (IDE) for both Mac OS X and iPhone (sorry PC, as noted in an earlier post, you’ll need a Mac to run these tools), Interface Builder, which is a drag and drop style UI construction tool, and Instruments, which is a real time performance data gathering facility. Another interesting developer tool is the iPhone simulator, whch allows you to test your app on a virtual iPhone. Xcode supports real time debugging of your apps on both the iPhone simulator and a real iPhone.
  • Learning Objective-C: A Primer - This isn’t really much of a primer – it’s more of a high level summary. Even if you are an old time C programmer, there is a lot to learn here. Give this a quick read but eventually you’ll want to review the authoritative source on Objective-C, which can be found here. I have to say, based on what I’ve seen so far, I am not a fan of this language. I’ll elaborate further in a future post but for now this is the only game in town so if you want to develop iPhone apps, you’ll have to swallow this pill.
  • Signing Code for iPhone Development – This is a high level summary of the code signing process Apple uses to ensure that you, as the author of  record of an iPhone app, are who you say you are and that you don’t change your code after it’s been released. Don’t worry about this too much for now – you can deal with code signing down the road when you have an application to sign.
  • Creating an iPhone Application – This is a very nice tutorial, which walks you through the creation of a sample application (“MoveMe”). Here’s what MoveMe does, in a nutshell: 
    Touching the Welcome button triggers an animation that causes the button to pulse and center itself under your finger. As you drag your finger around the screen, the button follows your finger. Lift your finger from the screen and, using another animation, the button snaps back to its original location. Double-tapping anywhere outside the button changes the language of the button’s greeting.

    You can download the code, build and test it yourself. The MoveMe app exercises a bunch of iPhone facilities so it gives you a good idea about how to do several specific tasks while at the same time giving you a general sense of how iPhone applications are structured and how the developer tools work.

  • iPhone OS for Cocoa Developers – This document is nothing more than a couple of paragraphs saying, basically, “if you’re already a Mac developer you already know how to use Cocoa”. Not a lot of help since I don’t fall into that category. Fortunately, the Cocoa Fundmentals Guide provides a comprehensive description of the Cocoa application environment. I’m (slowly) working my way through this document.
  • Frequently Asked Questions – This is a handy collection of commonly sought information, organized into neat categories. An ambitious developer might comb through these pearls of wisdom but I’ll read ‘em when I need ‘em.
Finally, one important document which is not mentioned in the list of getting started docs (it’s in the reference libary list) is the iPhone Application Programming Guide, which is a free, useful and comprehensive reference manual for iPhone app developers.
So, my next step is to download, build and test the MoveMe app, per the “Creating an iPhone App” doc, which should help me get the hang of a basic app and also some familiarity with Xcode and the other developer tools. At the same time, I’ll be working my through the Cocoa Fundamentals Guide. Someday, I’ll actually write some code of my own… :)

Leave a Reply