int multi = 7; int (^myBlock)(int) = ^(int num){ return num * multi; }; int result = myBlock(5); NSLog(@"结果是:%d",result);//输出结果是: 结果是:35 void (^printBlock)(NSString *x); printBlock = ^(NSStri…
本文来源为:developer.apple.com,仅仅是博主练习排版所用. Getting Started with Blocks The following sections help you to get started with blocks using practical examples. Declaring and Using a Block You use the ^ operator to declare a block variable and to indicate the…