1.用Apple文档的话来说,A block is an anonymous inline collection of code, and sometimes also called a "closure".
按我个人理解来说,一个block就是一个函数体变量,用于实现回调,优点在于可以方便地使用block所在函数体内的局部变量。
2.简单示例:
int (^maxBlock)(int, int) = ^(int x, int y) { return x > y ? x : y; };
3.block的几种适用场合:
任务完成时回调
处理消息监听回调处理
错误回调处理
枚举回调
视图动画、变换
排序
4.更多详情:http://mobile.51cto.com/iphone-397197_1.htm