title: Image Loading Animation issue using GCD
body: <p>Hi I'm using <strong>GCD to load image in the uitableview</strong> . Now, the problem is image animation. I called three images from server it loads into the cell but i got  3 problems </p>
  
  <p>1) Single image is repeated in all three cells</p>
  
  <p>2) first and last cell images blinking and changing</p>
  
  <p>3) when the image changed, it is repeated in all cells.</p>
  
  <p>Even though i gave animation none still it animates i.e. Blinking</p>
  
  <p>Code:</p>
  
  <pre><code>UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
  if (cell == nil) {
      cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
  }
  
  // Configure the cell...
  
  [imageArray retain];
  
  //get a dispatch queue
  dispatch_queue_t concurrentQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
   //this will start the image loading in bg
   dispatch_async(concurrentQueue, ^{ 
       NSData *image = [[NSData alloc] initWithContentsOfURL:[NSURL URLWithString:[imageArray objectAtIndex:indexPath.row]]];
  
       //this will set the image when loading is finished
       dispatch_async(dispatch_get_main_queue(), ^{
          cell.imageView.image = [UIImage imageWithData:image];
  
           [tableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationNone];
           });
      });
  
  return cell;
  </code></pre>
  
  <p>}</p>