Tuesday, November 30, 2010

iOS & Mac OS Development - Calculator tutorial

Calculator
So much has happened since this post, check out my new app on iTunes

Got my first Macbook Pro on November 16th. Since then I have been exploring the possibilities in iOS and Mac OS development. I was amazed on the amount of documentations on the subject compare to google app engine. Probably because of the fact that the amount of iDevices that people are using these days.

If anyone is looking into iOS development I would recommend looking into the Standford Developing Apps for iOS by Paul Hegarty on itune U. Don't worry it is completely free and you are basically getting a $13,000 per quarter Standford course for free. "It is a very exciting time for developers." as my buddy Money Mike would put it.

My first take on the framework and the Software Development Kit(SDK) environment is that it is a complete set of tools. Like any other framework it is extensive with lots of layers of technology and as my mentor Jason Wei would say "It takes about a month to learn the sytax of a language, however it'll take a lifetime to master a framework."

The current version of the development is Xcode 3.5.2 and iOS SDK 4.2. You can download it for free at http://developer.apple.com.

Objective-C is a superset of C and for those who grew up with C/C++ it should be intuitive to get around. On top of the Xcode development environment this is my first time owning a Mac and using the Mac OS. However, I feel pretty comfortable because of the vast amount of documentations and tutorials that are available.

"Learning - Welcome the unknowns and opportunities to make mistakes." ~ docchang



I completed a basic calculator with a few extra functions in iOS and Mac OS. You can find the source code for both builds below:
https://github.com/docchang/Calculator.iOS
https://github.com/docchang/Calculator.MacOS

I created the iOS version and ported the project to Mac OS. The calculator model stays intact, however a similar view needs be recreated using Mac OS objects. e.g UIButton -> NSButtonUILabel -> NSTextField. Obviously the controller needs to use the Mac OS objects and the logic stays the same. One interesting thing is that under Mac OS project the NSTextField can be mapped to Label and TextField in the view unlike an iOS project Label and TextField map to their own correspondents.

3 comments: