title: UITableView cell sometimes fails to update image, but displays fine after scroll
body: <p>Just to rule out the obvious, I am updating the UI from the main thread and I've read a bunch of similar questions. Sadly, none of them helped.</p>
  
  <p>In brief: the app tries to get an image for the current cell from its local cache. If it fails, it starts a background thread to download the image and then update the UI from the main thread. This works 90% of the time. When it doesn't, the <code>imageView</code> in the cell stays empty. It's interesting that this always happens with the same images.  </p>
  
  <p>However, the image gets updated as soon as the cell scrolls out of view and then back into view. </p>
  
  <p>There appear to be no significant differences between the images that show up immediately and those that do not. </p>
  
  <p>I also tried updating the cell with <code>setNeedsDisplay</code>, but that doesn't work either. What does work, but messes up my animations in addition to being a bit heavy-handed, is <code>[tableView reloadData]</code>.</p>
  
  <pre><code>// tableView:cellForRowAtIndexPath: 
  if(!pic) {
    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
      // download image, add it to the cache etc.
      dispatch_async(dispatch_get_main_queue(), ^{
          // check if cell is visible
          if ([[tableView visibleCells] containsObject: theCell]) {
            [[theCell imageView] setImage:pict];
            [tableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:idxp] withRowAnimation:UITableViewRowAnimationAutomatic];
          }
       });
    });
  }
  </code></pre>