One advantage in developing iPhone applications for existing Mac programmers is that it uses same language, same framework, same programming model and same programming style.
It is true.
However, there are some subtle differences between the two environment.
While I was watching iPhone Application Programming video podcast from Stanford University, I got to realize that there was a subtle but very important difference in Hello, World program.
Almost all Cocoa / Objective-C programming books start to explain about how easy it is to write Cocoa/Objective-C. They provide some examples for which you don’t need to write even one line. For example….
- Place a NSSlider instance on a window using the Interface Builder
- Place a NSTextField instance on a window
- Control-Drag from the NSSlider instance and drop to the NSTextField instance.
- Then, the Interface Builder presents a pop-up window which shows methods like “takeIntValueFrom“. Choose it.
- Now, the NSTextField instance takes int representation of current slider value
- Build your app and run it.
- While you slide the NSSlider instance, its value keeps being displayed in the NSTextField instance.
However, with Cocoa for iPhone, it is not possible. The UIControl class doesn’t have methods like takeIntValueFrom:. So, you can’t connect NSSlider value to an NSTextField instance using the Interface Builder.
So, you should write some lines of codes for the iPhone/iPod touch.
“No need to write even a single line” was big sales point of Cocoa, when Steve Jobs demonstrated its capability. He did such kind of demonstration in the early days of Mac OS X.
However, with introduction of iPhone SDK, many strong points of Cocoa doesn’t seem to exist. Apple Inc. doesn’t provide difference of iPhone and Mac development in this depth.
Are they experimenting a new programming model with the iPhone SDK? Or isn’t the iPhone SDK as mature as that for Mac yet?