I'm using UICollectionView
.
Images are coming from FTP server. Here is my code for downloading and Showing image on button :
[tempp sd_setImageWithURL:[NSURL URLWithString:[[arrFilterData objectAtIndex:indexPath.row] valueForKey:@"ZoomPrdImg"]] //PrdImg //ZoomPrdImg
placeholderImage:nil
completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
if (image) {
myCell.image.userInteractionEnabled = YES;
dispatch_async(dispatch_get_main_queue(), ^{
[myCell.image setImage:image forState:UIControlStateNormal];
[myCell setNeedsLayout];
});
}
}];
myCell.image
is my button that set downloaded image.
Now I don't get that image is successfully dowloaded but nut show in button. There's 3000+ images in UICollectionView
but it shows some image and some blank.
How this possible ? How to solve this ? What is issue there ?
EDIT:
tempp is allocted in viewDidLoad
- (void)viewDidLoad {
tempp = [[UIImageView alloc] init];
}