Note that there are some explanatory texts on larger screens.

plurals
  1. POAsynchronous Image Loading Flickering?
    text
    copied!<p>I have tried many ways of Asynchronously loading images and they ALL have this problem, this includes 3rd party frameworks. This leads me to believe its something to do with my cell for row index method.</p> <p>Anyway i am currently loading images Asynchronously using Grand Central Dispatch and Blocks, here is my code:</p> <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"CustomTableCell"; static NSString *CellNib = @"CustomizedCell"; CustomizedCell *cell = (CustomizedCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { NSArray *nib = [[NSBundle mainBundle] loadNibNamed:CellNib owner:self options:nil]; cell = (CustomizedCell *)[nib objectAtIndex:0]; } // Configure the cell... cell.Label.text = [self.TitleArray objectAtIndex:indexPath.row]; dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0ul); dispatch_async(queue, ^{ NSString *String = [[self.Array objectAtIndex:indexPath.row]; NSURL *url = [NSURL URLWithString:String]; NSData *Data = [NSData dataWithContentsOfURL:url]; UIImage *Image = [UIImage imageWithData:Data]; dispatch_sync(dispatch_get_main_queue(), ^{ cell.ImageView.image = Image; }); }); </code></pre> <p>This seems to load the images Asychrnously, but like with all my attempts at using 3rd party libarys, different code etc, the images flicker. What i mean by this that when you scroll the images of a cell seem to flicker and change to another image of another cell before quickly changing back, making it appear as if it is flickering. This only happens when you scroll and usually only to the top two and bottom two cells. Any ideas why? if anyone could help me with this problem i would really appreciate it!</p> <p>Thanks!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload