int nubmer = 10;
int(^block)(int) = ^(int a){
return a + nubmer;
};
nubmer = 5;
NSLog(@"%d",block(5));
__block int number1 = 10;
int(^block1)(int) = ^(int a){
return a + number1;
};
number1 = 5;
NSLog(@"%d",block1(5));
在没有使用__block修饰的时候,变量在block实现的方法中不可以被修改