Block

Blocks objects are c-based language feature that you can used in C/C++ or objective-C code.

A block is actually represented by an underlying data structure that resembles an object and is created and managed for you by the compiler. 

The compiler packages up the code you provide (along with any related data) and encapsulates it in a form that can live in the heap and be passed around your application.

Advantage:

use variables from outside their own lexical scope.

posted @ 2012-02-02 13:34  Kalou  阅读(183)  评论(0编辑  收藏  举报