id arr = [[NSMutableArrayalloc]init];
void(^block) (void) = ^(){
[arraddObject:@"1"];
};
block();
//这样,只是使用arr是没有问题的.
id arr = [[NSMutableArrayalloc]init];
void(^block) (void) = ^(){
arr = [[NSMutableArray alloc] init];
};
block();
//会报错,Variable is not assignable (missing __block type specifier),因为这时候,block内部对arr进行了赋值
网友评论