摘要:
-(void)viewDidLoad{[superviewDidLoad];//block1inti=10;//在block块只读__blockintj=1;//在block可以修改的变量int(^myblock)(int)=^(intnum){//可使用作用域内的变量j=10;returnnum*i;};NSLog(@"%d",myblock(10));[selftestBlock:^(NSString*str){NSLog(@"%@",str);}];}//block做参数-(void)testBlock:(void(^)(NSString*str) 阅读全文