Monthly Archives: March 2010

The pogo stick of NSRunLoop

Quick intro to NSRunLoop NSRunLoop is the object that manages the big event loop in the sky. Imagine you’re writing your own graphical OS.  A common way to build your control flow is with a loop like this: while(!UserRequestedShutDown(userInput)) { userInput = GetUserInput(); KeyApplicationHandleUserInput(userInput); } The loop continuously gathers and reacts to the user’s actions […]

Callbacks

In this post, I’ll enumerate four major types of callback mechanisms in Objective-C, and mention some comparisons to help choose the best one for whichever class you’re designing. Intuitively, a callback is a method that you think of as being called from outside your code. More formally, a callback is a method that can be […]

IBOutlet and IBAction

One of the first big confusions I confronted when learning to work with xcode and Interface Builder was the connection between things in my code (particularly those marked as IBOutlets or IBActions) and corresponding things in Interface Builder.  In many languages, you expect every file you work with to be explicitly mentioned by name somewhere […]

Firsties!

Ok, this is the obligatory blog intro explaining what the blog is about. iPhone OS coders, this blog is for you. As I’ve learned Cocoa Touch and become proficient in working with the iPhone SDK and related libraries and tasks, I’ve seen a lot of trouble spots that I’m sure affect many other coders as […]