1

私のオブジェクトには、次のようなインスタンス変数があります。

@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 です。

なぜ間違いなのか教えていただけませんか。

4

1 に答える 1