Generic typeof for weak self references

前端 未结 10 874
误落风尘
误落风尘 2020-12-07 11:29

I am trying to figure out a way to use typeof to create a weak reference to self for use in blocks to avoid retain cycles.

When I first rea

10条回答
  •  春和景丽
    2020-12-07 12:10

    i think use this to be ok:

    __weak __typeof(&*self)weakSelf = self;

    it reference AFNetworking's AFURLConnectionOperation.m codes.

提交回复
热议问题