本帖最后由 tz19900926 于 2015-9-27 18:23 编辑
#import <Foundation/Foundation.h>
typedef void (^myblock)();
myblock teset(){ return ^{ NSLog(@"xxxxx"); }; }
typedef int (^myblock2)(int ,int);
myblock2 teset2(){ return ^(int a,int b){ return a+b; }; }
int main(int argc, const char * argv[]) { @autoreleasepool { myblock N = teset(); N(); myblock2 M = teset2(); NSLog(@"%d",M(10,20)); } }
|