SRCarouselView icon indicating copy to clipboard operation
SRCarouselView copied to clipboard

multiple SRinfinitecarouselview with web images crashes with index out of bounds

Open dragab opened this issue 8 years ago • 1 comments

Hi ,

i tried to use two SRinfiniteCarouselView in the same viewcontroller , they dont have the same size of arrays , it works fine in simulator , but when debuging using a mobile , i get exception index out of bounds .

the error is on the following function

  • (SRImageManager *)imageManager {

    if (!_imageManager) { __weak typeof(self) weakSelf = self; _imageManager = [SRImageManager shareManager]; _imageManager.downloadImageSuccess = ^(UIImage *image, NSString *imageURLString, NSInteger imageIndex) { weakSelf.images[imageIndex] = image; if (weakSelf.currentIndex == imageIndex) { [weakSelf.currentImageView performSelectorOnMainThread:@selector(setImage:) withObject:image waitUntilDone:NO]; } }; } return _imageManager; }

dragab avatar Feb 07 '17 23:02 dragab

Sorry, i was busy with something recently. The reason is I should not use Singleton for SRImageManager, I have fixed it. Thanks for finding the bug.

guowilling avatar Feb 23 '17 08:02 guowilling