Mar 072008

The very first thing that’s important to note about this beta release of the iPhone SDK is that there’s currently no Interface Builder support, despite it being talked up at the demo yesterday.  This is a pretty serious blow to ease of development at this early stage.  Instead of simply dragging and dropping interface elements onto a form, you have to programmatically instantiate UI objects and place them into your view.

That’s not disastrously bad or anything, just frustrating; after using IB for so long, having to go without it sort of sucks.

The API is pretty well thought out.  It makes use of much of the Cocoa API we already know and love, with a new UIKit that provides the UI elements instead of using NSWindow, NSView, and so forth.  Instead, we have UIWindow, UIView, etc.  They work very similarly, except they’ve been tuned for the iPhone.

It didn’t take me too long at all to create my first “Hello world” application, which is good.

On the down side, the documentation is a bit of a mess at the moment; when you go to the “iPhone OS” documentation, you get a lot of links back into the Mac OS X documentation, and much of that material is almost — but not quite — accurate for the iPhone OS.  Obviously the writers have a little work left to do there.

It’s not in bad shape for a beta, though (aside from the missing IB support thing).

There are some nice APIs for things like tracking touches on the screen, monitoring the accelerometer (you simply register to receive notifications of accelerometer events, and a delegate gets called as the user tips the device), and so forth.

Video playback is supported but only in full-screen mode.  That’s not a tragedy, but it’s a mild bummer.

Audio playback has both support for short sounds (five seconds or less) and for streaming audio files off  the flash storage (but only one at a time).  That’s more than adequate for any use cases that I can legitimately think of.  It also supports 3D positioning of audio, audio recording, and streaming audio over CFNetwork connections.  Excellent.

Handling rotation of your view is as simple as using a view controller and having it accept a call that notifies it that the display has rotated.

Generally the API is quite refined from a first glance, and looks like a lot of solid thought went into it.  I look forward to being able to do some real work with it to see what I can do.

The “Aspen Simulator,” which lets you test your code on your Macintosh, is a bare-bones iPhone simulator.  It has Safari, Photos, Contacts, and Settings apps on it, but otherwise doesn’t have the apps an iPhone normally has.  When you create your iPhone project, it defaults to running on the Simulator.  To test, all you do is Command-R to run it, and the Simulator launches and automatically starts up your app.  There are menu options that let you rotate the device left and right, and you can simulate pinching (two-finger) touch events by holding down the Option key while clicking and dragging on the touch screen.

Debugging works great as well.  If you choose to run in debug mode, it works just like you’d expect. Single-stepping, tracing, watching variables, and so forth all work exactly like they do when debugging a Mac application, right within Xcode.

There are a couple of disappointments.  The lack of IB is (have I mentioned this before) a real bummer.  The fact that it’s a beta is a bummer as well, although not exactly a surprise.

The license agreement for the SDK is also fairly disappointing, in that it disallows development of apps that run interpreted code, among other things.  This may prevent Mobile Firefox from being done on the iPhone.  I for one would have liked to see someone do a port of Mobile Firefox to the iPhone, if for no other reason than to have a platform that I personally carry around with which I could show it off to people.

I also had hoped to work on porting an emulator I’ve spent several years helping to develop to the iPhone, but at first glance, I fear that the license terms may not allow emulation.  It’s a question I’ll have to ask.

At any rate, despite the minor disappointments and frustrations, the iPhone SDK is a huge, huge step in the right direction, and I’m very enthusiastic to see where things go from here.

 Posted by at 12:37 PM

  3 Responses to “The iPhone SDK: First impression”

  1. Thanks. Excellent post.

    Keep us aprised of your progress with the SDK.

  2. Have you had any problems getting the debugger to show the values of instance variables?

    Instance variables from UIKit classes don’t show their values for me – only the name, class and memory location.

    Was there a change you had to make to the Build Settings except for the Include Debug Symbols checkbox?

    I can’t seem to resolve this – even after reinstalling the SDK twice.

  3. I didn’t have to make any changes to the build settings to use the debugger. I don’t recall offhand whether I had any issues with seeing instance variables’ values though. I’ll have to try it.

This site uses Akismet to reduce spam. Learn how your comment data is processed.