Even though I've used Macs for over 20 years now, I have never developed a native app for the Mac OS. So over the holiday break, I finally spent some time getting ramped up on Objective-C to develop apps for Mac OS X and IOS. This meant reading a lot about Objective-C, XCode and Cocoa.
I'm primarily a Java developer these days but I'm familiar with writing C code (though I haven't written it in many years) so this knowledge helped me quite a bit. The syntax for Objective-C was a bit strange at first but I got the hang of it after a bit and I'm continuing to learn. I managed to develop a command line app and a GUI app using XCode. Building the command line app was much more understandable for me because you are writing all the code by hand. Constructing the GUI app was a rather nebulous task mainly because you rely upon the IDE to handle many things for you. XCode is the IDE for building Objective-C apps for Mac OS X and IOS. When developing a GUI app, XCode provides a visual tool called Interface Builder that is amazing. It provides a standard set of widgets for your apps and allows you to do visually design the UI. Interface Builder simplifies the creation of connections from the code to the GUI widgets via dialogs and selections in those dialogs. Because the actual code to handle these things is hidden behind the IDE, the experience was rather cloudy in my mind. At some point, I plan to dig down into what is actually happening behind the curtain here to solidify it in my mind. I also used the XCode debugger and profiler which were both very nice tools and were both included in the IDE.
I forgot to mention that I am using Objective-C 2.0 and XCode 4.2. This is not only a new release of Objective-C but it's also a new release of XCode with a dramatically improved set of functionality. My prior experience was with XCode 3.x, it was minimal and I was not writing Objective-C, so I didn't really get to experience the power of XCode. Now that I've been through a couple of tutorials with XCode 4.2 and Objective-C, I must say that I'm duly impressed. In fact, Eclipse could stand to learn a few things from XCode. Objective-C 2.0 is a big improvement over the previous version. There's now automatic reference counting to help you with memory management (the big thing I hated about C/C++) and much more.
The apps I created run on Mac OS X. They are both very minimal and not very useful overall, but it is invigorating to delve into new territory for a platform that I have known and loved for over 20 years already. I plan to keep at it as time allows and build some useful apps. Perhaps I will even develop some IOS apps.
For those who are interested, here are the two tutorials that I followed:
- Coding in Objective-C 2.0 by my friend Bill Dudney - Although this is a bit dated because it does not use XCode 4.2, I found it to be a great start
- Your First Mac App - Apple provides a ton of docs to begin creating apps in the Mac Dev Center
I've also been reading many blogs from Objective-C and Cocoa developers. I also found some items for Java developers who want to learn Objective-C:
- Objective-C Programming Language
- Cocoa Fundamentals Guide
- Foundation Framework Reference
- Core Foundation Framework Reference
- AppKit Framework Reference
- Learn Objective-C
- ManiacDev.Com, iPhone, iOS, iPad SDK Development Tutorial and Programming Tips
- Objective-C for Java programmers, Part I
- Objective-C for Java Developers presentation
- Briefs Build it, share it, real fucking fast - A very cool app for prototyping IOS apps (watch the video)
I will try to keep adding info about resources here as I think about them. Not only is this a record for myself, but hopefully it will help other folks as well.