Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImageView loading some different cell image iOS 8 #54

Open
abhinavsingh89 opened this issue Oct 14, 2014 · 2 comments
Open

ImageView loading some different cell image iOS 8 #54

abhinavsingh89 opened this issue Oct 14, 2014 · 2 comments

Comments

@abhinavsingh89
Copy link

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
Copy link
Author

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.

@nicklockwood
Copy link
Owner

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];

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants