Category Archives: Objective-C

At WWDC 2014 Apple introduced Swift, a new programming language for iOS and OS X developers. Objective-C has had a long and distinguished run with Apple, but times change and we move on. In recognition of this, and in reference to the [objC retain]; shirts of days gone by, I set up a Teespring campaign to say goodbye-- gradually-- to Objective-C.

objC-autorelease-orange-Teespring objC-autorelease-blue-Teespring

Why not [objC release];? Swift is the clear way forward, but Objective-C won't be disappearing right away. In this context "autorelease" implies "release later". Objective-C doesn't disappear right now, but just wait until the end of the run loop...

All profits from these shirts will be donated to App Camp For Girls. (This campaign is not affiliated with App Camp For Girls, I just think it's a good idea).


Over at the Big Nerd Ranch blog, my friend Mark Dalrymple continues his "Inside the Bracket" series with an article on practical uses of Objective-C's run time introspection.

Last time you saw the parts of the Objective-C runtime API that let you query a bunch of the metadata the compiler keeps around once it’s done building your project. Like most discussions of API, it was pretty abstract. “Look at all the pretty tools! Ooh, we can print out Lists of Stuff! Isn’t that amazing!”

This time around is an actual application of this API for Great Justice. I was working on a client project that consumed blobs of JSON data from a third-party web service.

Converting JSON to Objective-C objects is fraught with some peril, but with the code Mark presents it becomes a lot safer.

Mark's code, incidentally, is an improved version of some code I wrote and discussed on Cocoa is My Girlfriend. Mark's version is better, though.