标签:
#import <Foundation/Foundation.h> typedef int (^Myblock)(int, int); int main(int argc, const char * argv[]) { Myblock myblock; myblock = ^(int a, int b){ return a-b; }; int sum = myblock(5, 3); NSLog(@"%d", sum); return 0; } void test2() { int (^sumBlcok)(int, int) = ^(int a, int b){ return a+b; }; int sum = sumBlcok(5, 6); NSLog(@"%d", sum); } void test() { void (^myblock)() = ^{ NSLog(@"myblock"); }; myblock(); }
标签:
原文地址:http://www.cnblogs.com/jsnan/p/4340478.html