我的对象有一些实例变量,如下所示:
@interface MyObject : NSObject
{
@private
NSDictionary * resultDictionary ;
}
这是方法:
- (void) doSomething
{
__weak typeof(self) weakSelf = self ;
[TaskAction invoke:^(NSDictionary* result){
if(result){
weakSelf->resultDictionary = result ; // dereferencing a weak pointer is not allowed due to possible null value caused by race condition , assign it to strong variable first ...
}
}]
}
iOS编译器抛出一个错误://由于竞争条件可能导致空值,不允许取消引用弱指针,首先将其分配给强变量...
错误语句是 :weakSelf->resultDictionary = result ;
你能帮我看看为什么会出错。