Need help?

I'm available for remote short term contracting or consultancy work. Please check out my LinkedIn profile for more details on my experience.

Please feel free to use the form below to contact me.



Functions

I'm going to be referring to iOS related Objective-C, as the blocks were just released in version 4, so it's an interesting topic.

Before the blocks functionality, the typical way to do a callback would be to pass the delegate of the object which would be called to the worker object. Once the worker object finished the task, it would then reference a specific method (defined by the protocol), which executes the callback code. This approach works fine, but gets very bloated when you need to do certain kinds of tasks - not going to be getting to the protocols vs blocks in this article though. They do both serve their own purposes, and I'm just going to be getting into the relations they have to the Java anonymous classes.

jon | February 22, 2012 | Comments (2)