假设我有一个对块有强引用的对象.在执行该块的某个时间,强引用设置为nil.块是否保证完成执行,或者这会导致崩溃?我已经看到了exc-bad-access错误,但是我无法可靠地生成它们,所以我不知道它们为什么会弹出.
例如:
-(void)method
{
self.block = ^{
//code
self.block = nil;
//more code - crash here?
}
}
-(void)otherMethod
{
block();
}
Run Code Online (Sandbox Code Playgroud)