Sunday, April 6, 2008

iPhone SDK first impressions

I've been working with the iPhone SDK lately. I'm working on an application to input receipt information for expense reports. It's a fairly simple app, but its useful to me and a good starting point.

Here's the things I like so far:

  • Apps are written in Objective-C and use the same Foundation framework as OS X apps. Things like NSArray, NSDictionary, NSDate are all the same. If you have any experience writing Cocoa apps, you can get started on iPhone apps fairly easily.

  • iPhone development is well integrated into XCode. You just pick an iPhone app template and go. The "Build and Go" button will build and deploy your app to the built in simulator.

  • The Cocoa Touch UI widgets are nice. Apple did the smart thing and built a new UI framework from the ground up. The iPhone interface is quite a bit different, so trying to shoehorn desktop UI widgets would have been a mistake. UITableView is easy to use and extend. I'm using it on just about every screen.

  • There is a lot of good documentation so far. I know its still in beta, but there is a lot of sample code, videos and API docs.

The SDK is still in beta and there are a few rough edges. Some problems I've run into:

  • Interface Builder is not usable. The second release of the SDK included Interface Builder for the iPhone. There are no project templates available to set up an iPhone project with Interface Builder. I searched around and found out how to add the IB xib file to the build and show it on the screen. It is not as seamless as it is in the desktop version. I'm sure this will get fixed by the time the SDK leaves beta. Fortunately, the SDK is still quite usable without Interface Builder.

  • OpenGL, CoreLocation and other frameworks are not useable in the simulator. I can understand the technical problems in getting these to work, but Apple is not accepting developers into the iPhone Dev Program very quickly. So, its impossible to work on any apps using the frameworks that won't run in the simulator.

  • I can't figure out how to get OCUnit to work in the SDK. After being immersed in TDD while working at ThoughtWorks, it would be nice to be able to unit test my iPhone code. I'm still not familiar with how OCUnit works, so I haven't figured out if there is a way to have tests run in the simulator.

It's been fun getting away for web apps for a bit and working on mobile devices again. I think the iPhone has great potential, and the SDK is quite powerful. It will be interesting to see all the applications that will come out for it. I think the iPhone also has potential in the enterprise space. It looks like Apple has thought about that, too. I'm eager to see how their enterprise developer program turns out.

No comments: