在block中使用self

__weak typeof(self) weakSelf = self;

[self doABlockOperation:^{

    __strong typeof(weakSelf) strongSelf = weakSelf;

    if(strongSelf) {

        ...

    }

}];

 

posted @ 2015-11-18 14:23  韦韦韦  阅读(219)  评论(0编辑  收藏  举报