AsyncImageView icon indicating copy to clipboard operation
AsyncImageView copied to clipboard

ImageView loading some different cell image iOS 8

Open abhinavsingh89 opened this issue 9 years ago • 2 comments

Please note this issue is happening only on iOS 8.0+

I have a collection view controller located in one tab(single page only right now, so cells are not actually reused). When I first go to this tab the first icon loads exact image, but as soon as it loads the 5th icon, it replaces 1st icon image with this first image, when I come back to this tab again(which is again refreshing), it sets it right. This issue is happening only with iOS 8.

  • (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { KBGameCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"GameCell" forIndexPath:indexPath];

    EBOXAppInfo *content = (EBOXAppInfo *)_gAppData.platformApps[indexPath.item];

    NSURL *iurl; iurl = content.urlIconImage; NSLog(@"URL for app : %@ : %@ ",content.name, iurl);

    cell.appIcon.image = nil; [cell.appIcon setShowActivityIndicator:YES]; cell.appIcon.imageURL = iurl; [cell.appName setText: content.name];

    NSString *categoriesText = [_gAppData localizedCategoriesForAppInfo:content];

    [cell.tagsLabl setText:categoriesText]; cell.appIcon.imageURL = content.urlIconImage;

    return cell; }

abhinavsingh89 avatar Oct 14 '14 16:10 abhinavsingh89

Just an addition to this, If I do the above process slowly, i.e. by applying breakpoints, it is correct, but without breakpoints, it is showing one image at two places.

abhinavsingh89 avatar Oct 15 '14 16:10 abhinavsingh89

You seem to be setting cell.appIcon.imageURL twice for each cell - is that deliberate?

In any case, try calling this before setting the URL:

[[AsyncImageLoader sharedLoader] cancelLoadingImagesForTarget:cell.appIcon];

nicklockwood avatar Oct 16 '14 12:10 nicklockwood