Recently I started thinking about writing something simple in Objective C – you know, that weird Apple language used for Mac programming… Not that I’m planning to switch from Ruby to ObjC – I rather treat this as a kind of a challenge (“what, I can’t learn this thing? of course I can!” :), besides, there is no language good for everything, and there are some low-level things that you really shouldn’t write in Ruby, like plugins for Finder, Quicklook, etc. Also, I remember reading somewhere that it’s good for a programmer to learn a new language each year – so, two years ago Python, last year Ruby, this year Objective C? :)
I googled for some quick tutorials, read a couple of them, and I realised that this language is really very simple, it just looks complicated because of that syntax and symbols; but once you start translating everything in your head, it all starts looking very familiar. Of course, it’s a different thing to understand what’s going on in someone’s code and to be able to write your own (for that, you also need to know some libraries…); but in this case, it’s pretty easy to go from “OMG WTF dude what’s this??” to a state when you can look at ObjC code and understand it as if it was written in Java or something else.
I made some notes while I was reading the tutorials, and I’m publishing them here so that maybe someone can learn this faster than I did – it’s just a “diff”, so I didn’t describe in detail anything that is obvious for someone who knows C, Java, Ruby, etc. You can treat this as a kind of poor man’s tutorial… Although I’m warning you that I spent a total of about one day looking at ObjC code, so some of what I’ve written here may not be completely correct, or may even be completely wrong. This is all based on what I read, not on my own experiences (which I have almost none). This product is provided without any warranty :)