1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > Capturing 'self' strongly in this block is likely to lead to a retain cycle

Capturing 'self' strongly in this block is likely to lead to a retain cycle

时间:2019-01-18 17:51:50

相关推荐

Capturing 'self' strongly in this block is likely to lead to a retain cycle

技术分享»Phone|阅读(1629)|评论(0) May 10 pletionBlock = ^{

[self stopPlay];

};

上面在block里用self是会有提示:

Capturing 'self' strongly in this block is likely to lead to a retain cycle

可以这样改一下

__weak typeof(self) weakSelf = self;

pletionBlock = ^{

[weakSelf stopPlay];

};

参考自:/questions/14556605/capturing-self-strongly-in-this-block-is-likely-to-lead-to-a-retain-cycle

frameborder="0" scrolling="no" src="/A1/weiboshare.html?url=http%3A%2F%%2Fblog%2Fread.php%2F1771.htm&appkey=&type=4&ralateUid=1564565147" width="142" height="32">

原创内容如转载请注明:来自阿权的书房

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。