Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7789143
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T21:12:34+00:00 2026-06-01T21:12:34+00:00

I’m loading images onto a UITableView asynchronously (GCD), and am seeing a strange behavior

  • 0

I’m loading images onto a UITableView asynchronously (GCD), and am seeing a strange behavior where the cell will “shutter” through multiple images before settling on one. It’s hard to describe in words, so I made a screen recording, where you’ll see that for a given cell, multiple images will shift through before it settles on one.

http://www.youtube.com/watch?v=PKuqng81QX4

I’m using a queue to fetch the image (from a REST endpoint), and then the main queue to set the image in the cell. Here’s the code snippet:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath

// ..after getting the cell:

    dispatch_queue_t imageQ = dispatch_queue_create("imageQ", NULL);
    dispatch_async(imageQ, ^{
        NSString *galleryTinyImageUrl = someFunctionToGetThumbnailUrl;
        NSData *imageData = [[NSData alloc] initWithContentsOfURL:[NSURL URLWithString:galleryTinyImageUrl]];
        dispatch_async(dispatch_get_main_queue(), ^{
            cell.imageView.image = [UIImage imageWithData:imageData];
            [tableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationNone];
        });
    });
    dispatch_release(imageQ);

The fact that this is getting called multiple times in short time (i.e. a user flicks up on the table, triggering 30 of these cell image loads to fire off) causes concern for me whether all of the async threads “land” safely where they’re supposed to. The behavior I’m seeing (in the video) seems to validate that I’m doing something wrong here. I’d appreciate any specifics or broad approach suggestions you might have.

Thanks for the help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T21:12:35+00:00Added an answer on June 1, 2026 at 9:12 pm

    Sounds like you did not properly implement reusing of cells.
    Make sure to, when reusing a cell via [tableView dequeueReusableCellWithIdentifier:blah] you set the cells image to nil until the new image has been fully downloaded and is ready to be displayed.

    Also, when reusing a cell, cancel a potentially running request for its image to prevent having a image of a previous cell load slower and therefore overwriting the real one.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I used javascript for loading a picture on my website depending on which small
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
i want to parse a xhtml file and display in UITableView. what is the
I need a function that will clean a strings' special characters. I do NOT
I am trying to loop through a bunch of documents I have to put
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.