blocks


(1)
void (^BarkCallBack) (Dog *thisDog,int count);//定义一个参数是Dog和int返回值是void类型的block变量:BarkCallBack
(2)void (^BarkCallBack) (Dog *thisDog,int count) = ^(Dog *thisDog,int count)
{
     NSLog(@"dog ID is %i barkCount is %i",[thisDog ID],count);
}
(3)  typedef void (^BarkCallBack) (Dog *thisDog,int count);//声明一个参数是Dog和int返回值是void的block类型的别名:BarkCallBack;/*然后BarkCallBack barkCallBack;用该类型的成名一个改block类型变量
(4) barkCallBack(self,barkCount);//该变量传递参数
原文地址:https://www.cnblogs.com/leevaboo/p/3144420.html