title: Asynchronously set images in tableview
body: <p>I have a <code>TableView</code> using custom cells. I initially was setting grabbing an image from a URL in the <code>cellForRowAtIndexPath</code> method</p>
  
  <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  {
      static NSString *simpleTableIdentifier = @"SimpleTableCell";
  
      SimpleTableCell *cell = (SimpleTableCell *)[tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier];
      if (cell == nil)
      {
          NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"SimpleTableCell" owner:self options:nil];
          cell = [nib objectAtIndex:0];
      }
  
      NSDictionary *dictObject = [places objectAtIndex:indexPath.row];
      cell.nameLabel.text  = [dictObject valueForKey:@"PlaceTitle"];
  
      NSURL *url = [NSURL URLWithString:@"http://images1.fanpop.com/images/image_uploads/Mario-Kart-Wii-Items-mario-kart-1116309_600_600.jpg"];
      NSData *data = [NSData dataWithContentsOfURL:url];
      UIImage *image = [UIImage imageWithData:data];
      cell.thumbnailImageView.image = image;
  
      return cell;
  }
  </code></pre>
  
  <p>but this was making my TableView scroll laggy. Once I removed the image fetch, it scrolled fine, so I know this is my problem.</p>
  
  <p>My question is: how can I asynchronously fetch this image and set it in my cell? Is there an easy way to do this? Thanks!</p>