Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
One of the most recent additions to Objective-C is support for blocks, also known as closures. Blocks were part of Smalltalk, but omitted in Objective-C for several reasons. Smalltalk used them for flow control, while Objective-C inherits C flow control primitives, so does not require them. The extra complexity in the compiler and runtime library, along with the speed penalty, meant that they were not a high priority for Objective-C, initially.
A closure is a function that can be created inside some other scope and can refer to variables inside that scope. Normally, a function may refer to three things: globals, arguments, and local variables. It may only exist in the global scope. In contrast, a block may be declared inside a function, or even inside another block. It may refer to any variables that are visible where the block is declared.