_player.completionBlock = ^{
[self stopPlay];
};
[self stopPlay];
};
上面在block里用self是会有提示:
Capturing 'self' strongly in this block is likely to lead to a retain cycle
可以这样改一下
__weak typeof(self) weakSelf = self;
_player.completionBlock = ^{
[weakSelf stopPlay];
};
_player.completionBlock = ^{
[weakSelf stopPlay];
};
参考自:http://stackoverflow.com/questions/14556605/capturing-self-strongly-in-this-block-is-likely-to-lead-to-a-retain-cycle
frameborder="0" scrolling="no" src="http://hits.sinajs.cn/A1/weiboshare.html?url=http%3A%2F%2Fwww.aslibra.com%2Fblog%2Fread.php%2F1771.htm&appkey=&type=4&ralateUid=1564565147" width="142" height="32">
原创内容如转载请注明:来自 阿权的书房