Tag Archives: delegate

Introducing the Default Delegate design pattern

I recently posted an overview of callback mechanisms in Objective-C, including the pros and cons of delegates versus target/action pairs; in this post I’ll introduce a new design pattern that combines many of the benefits of both of these approaches into a single technique. If you’re building a class to be reused many times, it […]

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 […]