title: UICollectionView mysterious crash
body: <p>I have a <code>UICollectionView</code> where I am filling up the cells with images downloaded from the Internet. For this I am using <code>SDWebImage</code>. My code looks like this:</p>
  
  <pre><code>-(UICollectionViewCell*) collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
  
      NSString *CellIdentifier = @"Gallery_Cell";
  
      GalleryCell *cell= (GalleryCell *)[self.flowCollection dequeueReusableCellWithReuseIdentifier:CellIdentifier forIndexPath:indexPath];
  
      if (indexPath.row &lt; self.collectionData.count) {
  
          CellDetails *dets = [self.collectionData objectAtIndex:indexPath.row];
  
          NSURL *mainImageURL = [NSURL URLWithString:dets.imageURL];
  
          cell.image.contentMode = UIViewContentModeScaleAspectFill;
          cell.image.clipsToBounds = YES;
  
          [cell.image setImageWithURL:mainImageURL placeholderImage:nil];
      }
  
      return cell;
  }
  </code></pre>
  
  <p>I believe I have set this up correctly. But the app crashes (<code>EXC_BAD_ACCESS</code>) completely at random sometimes leaving this stack trace:</p>
  
  <p><img src="https://i.stack.imgur.com/jrJZK.png" alt="enter image description here"></p>
  
  <p>There is no other message in the log area. I tried setting an exception breakpoint, but each time this crash occurs, showing this stack trace. Does anyone have any idea what might be the problem?</p>