Let me provide some context on my background, so you know where I'm coming from:
- Prior to purchasing an iMac just over a week ago, I had never done any coding on a Mac platform
- This was the first time I had written code in Objective-C
- I am a software architect who has worked primarily on systems running on Linux/Unix platforms. I have been doing OO Design and Development for 13 years
Development Platform
You have to use Apple's SDK on a Mac platform to do the coding. There is no SDK for Windows. Also, the only apps that you can distribute on Apple's App Store are ones that have been built on a Mac platform.
While you can "jailbreak" your iPhone so that you can write code for it on Windows, you won't be able to distribute / sell your apps on the Apple App Store. That's a significant business concern. You can sell / distribute your jailbroken apps on a site called Cydia, but I don't know many iPhone users would "jailbreak" their phones and buy apps from a 3rd party other than Apple.
So, on the one hand, developers benefit from the iPhone platform, which provides:
- a soup-to-nuts platform for distributing and selling their apps through the Apple Store
- a growing customer base (iPhone = mass market)
- you have to develop Apple's Way: their platform + their SDK
- Apple takes a 30% cut of sales from iPhone apps
- to register as an app developer costs $99+
From a business perspective, I decided to go with the "standard" way of write iPhone app code, which meant I had to buy a Mac. That was fine with me, it was a good reason for me to learn the Mac platform (where stuff lives, keyboard shortcuts, etc). So far, I've enjoyed using my iMac, but that is another topic for another day.
So I bought my iMac and registered on the Apple Developer site. I submitted an application for my company 6 days ago, and I am still waiting to hear from Apple if it's been approved. In the meanwhile, I downloaded and installed the SDK. You don't actually need an iPhone device to write apps; there is an iPhone Simulator for running and testing your code.
Impressions of the SDK
I'm not going to go into detail about how to use Xcode and Interface Builder, as online tutorials cover that.
I do recommend the tutorials on icodeblog.com; you can start with the Hello World tutorial. While Apple's site has good reference and architecture documentation, I recommend using online tutorials on blogs, because you can read the comments and questions from other folks using those tutorials. That's not a ding on Apple, it's typical of a lot of development languages, frameworks, and toolkits. It's the power of Web 2.0.
In terms of ramping up on iPhone app development, there are really 2 separate topics:
- learning the programming language Objective-C
- learning the Xcode and Interface Builder SDK apps
I programmed C and C++ middleware back in the 1990s for several years, and I did some complex makefile writing. But since 1997, the OO language I've used the most is Java. So it was interesting to see header files again; I've gotten used to having one file for the interface and implementation, as is the case with languages such as Java and Ruby.
A big part of the learning curve for Objective-C is learning the API libraries. That's the case with any language.
Several things stand out about Objective-C:
- you have to manage memory
- the syntax for invoking methods on an object
- it supports dynamic typing
- (void)dealloc {
[txtFirstName release];
[txtLastName release];
[lblMessage release];
[super dealloc];
}
The other interesting thing is the syntax for invoking methods (messages) on objects. E.g.:
Fruit *orange = [[Fruit alloc] initWithName:@"Orange" description:@"Citrus rocks for juicing"];
Xcode is the "main" IDE for organizing files and resource in projects and writing Objective-C code. Interface Builder (IB) is the tool for UI elements: specifying UI elements on the canvas, setting their properties, and tying them back to Controllers in XCode.
The Xcode and IB IDEs have the typical Apple high-quality "polish" in terms of elegant UI design, and they are very stable.
Here are some criticisms:
- There isn't a built-in unit testing framework for iPhone app development
- The console/log error messages and stack trace can be quite cryptic
- Xcode and IB are separate apps. You need to be conscious about saving files in one IDE if you are working with the other IDE
The console error messages can be quite cryptic, and the stack trace is not human-readable. E.g. here are the console error messages caused by an unrecognized method ("selector") call on an object:
2009-05-12 09:04:47.870 HelloUniverse[1098:20b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSCFString fooCall]: unrecognized selector sent to instance 0x55c690'
2009-05-12 09:04:47.871 HelloUniverse[1098:20b] Stack: (
2459910411,
2473467451,
2459939594,
2459932940,
2459933138,
10465,
816115430,
816516406,
816517630,
816514372,
816216343,
816148479,
816144864,
827743722,
827753484,
2459411957,
2459413720,
827745792,
827745989,
816114848,
816160924,
9156,
9010
)
Summary
Apple has provided a feature-rich app development environment, albeit limited to their own Mac platform and SDK. Apple could improve their SDK for iPhone apps to support unit testing and make tracking down bugs easier.
I'd love to hear your opinions, so please post them!




