issues
search
gsdios
/
SDCycleScrollView
Autoscroll Banner. 无限循环图片、文字轮播器。
MIT License
6.18k
stars
1.5k
forks
source link
内存泄漏
#701
Open
thesixdream
opened
2 years ago
thesixdream
commented
2 years ago
(void)scrollToIndex:(int)targetIndex { if (targetIndex >= _totalItemsCount) { if (self.infiniteLoop) { targetIndex = _totalItemsCount * 0.5; [_mainView scrollToItemAtIndexPath:[NSIndexPath indexPathForItem:targetIndex inSection:0] atScrollPosition:UICollectionViewScrollPositionNone animated:NO]; } return; } [_mainView scrollToItemAtIndexPath:[NSIndexPath indexPathForItem:targetIndex inSection:0] atScrollPosition:UICollectionViewScrollPositionNone animated:YES]; } 如上, [_mainView scrollToItemAtIndexPath:[NSIndexPath indexPathForItem:targetIndex inSection:0] atScrollPosition:UICollectionViewScrollPositionNone animated:YES]会导致内存泄漏,麻烦修复,谢谢