04 Jul 2012
App Store Chore
“Trying [Again!] to Learn Cocoa and Objective-C”
appstorechore01

Ever since I was a young man…​ er…​ well, for about the past two or three years anyway, I’ve wanted to teach myself the mystical arts of iOS programming. That is, programming for the iPhone and iPad.

If, in more civilised times, it was thought that everyone ‘had a book inside them’, then surely the equivalent de nous jours is to believe that everyone has an app inside them. I know I do. I’ve got a couple of ideas for iPhone/iPad ideas that are so exciting, I sometimes think I should pre-emptively kill everyone else in the whole world --just in case someone out there steals one of them.

Mind you, the trouble with designing apps for iOS is that, in order to do so, you need to learn two things:

  • Objective-C, which is the programming language at the heart of all Apple software, and…​
  • Cocoa, which is a set of commands for presenting the visual interface [aka. GUI] of whatever application you want to create.

In my short time on this Earth, I’ve probably embarked on a mission to learn iOS programming about half a dozen times. Sometimes I’ve even got two or three chapters into whatever book, or tutorial I’m reading before I hit the…​ [at this point you should envisage me rubbing the corner of the page of a book between two fingers, while looking confused] …​moment, which is a mime me and an old mate came up with years ago to signify that point in a book on coding when --everything previously having made perfect sense-- you are suddenly so completely baffled that you have to check you’ve not turned over several pages at once, by mistake.

Anyway, a week or two ago, in a moment of madness, I decided to make one last quest for enlightenment, when I discovered that the Techotopia website had a couple of online books available, dedicated to the art of iOS programming. I started reading iPad iOS 5 Development Essentials one night and managed to get several chapters in, without feeling the familiar sensation of my brain shrinking back in terror within my skull.

appstorechore02
Some bed-time reading

So far, so good.

Then, the next day, I idly started reading through another of their ouevres, Objective-C 2.0 Essentials. Here again, I got several chapters in, without smoke pouring from my ears and suddenly had a realisation:

The reason I’d understood everything I’d read so far, was that both books [Objective-C 2.0 Essentials especially], had started off by introducing the basics of Objective-C programming, without entangling it in lots of Cocoa code. The Objective-C examples presented in Objective-C 2.0 Essentials made sense to me because they were designed to be run on the command line [ie. without any user interface] and, stripped of all their excess Cocoa baggage, they actually looked like the kind of language and syntax constructs I was familiar with from dabbling in other programming languages, such as Ruby, Javascript, PHP and [God forbid!] ActionScript.

appstorechore03
More bed-time reading

So, I’m now working on the theory that I might just be able to crack this particular nut by trying to get to grips with Objective-C by itself first --by learning to write command line apps-- and only later, after I’ve got my head round this, embarking on the quest to learn how to use Cocoa to make them look ‘purdy’.

Since this moment of Epiphany, I have finished reading the complete online version of the Objective-C 2.0 Essentials book and, tinkering around with Vim and iTerm, have managed to create a very basic, but functional nonetheless, early first command line draft of one of my app ideas. What I’ve produced so far would make a seasoned iOS programmer laugh in ridicule so much, that some wee might come out but, for me, it’s a great leap forward and gives me hope that, some far-off day in the future, I might even see an app I made languishing in the remainder bins at the Apple App Store.

appstorechore04
Suck my code, bitches!
Meta

TAGS: objective-cobj-ccocoaiosprogrammingcodingiphoneipodipad

ORIGINAL PUBLICATION DATE: 04 Jul 2012

AUTHOR: stíobhart matulevicz

LAST MODIFIED: 25 Apr 2020  — REASON: "extract asciidoc preamble into separate file and include it"

Back to Top