title: iOS7 UICollectionViewCell not being reused when dequeuing cell
body: <p>the method </p>
  
  <pre><code>-(void)prepareForReuse 
  </code></pre>
  
  <p>In my collection view cell is never called - leading me to suspect that the <code>UICollectionView</code> is not dequeuing cells properly. This is causing lagyness and memory issues.</p>
  
  <p>I've set up my collectionView as follows:</p>
  
  <pre><code>static NSString *cellIdentifier = @"Mycell";
  -(void)initMyView
  {
      [self.collectionView registerClass:[UrlLoadableCollectionViewCell class] forCellWithReuseIdentifier:cellIdentifier];
  }
  
  -(UICollectionViewCell*)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
  {
              UrlLoadableCollectionViewCell *cell = [self.collectionView dequeueReusableCellWithReuseIdentifier:cellIdentifier forIndexPath:index];
      if (cell.contentView.frame.size.width &lt; 100) // tried removing this as well but didn't help
      {
          cell.layer.shouldRasterize = YES;
          cell.layer.rasterizationScale = [UIScreen mainScreen].scale;
      } else {
          cell.layer.shouldRasterize = NO;
      }
                  // prepare cell
  }
  </code></pre>
  
  <p>EDIT</p>
  
  <p>Additional Code</p>
  
  <pre><code>static NSString *cellIdentifier = @"Mycell";
  
  @interface UIThumbnailGalleryView
  @property (nonatomic,strong) UICollectionView *collectionView;
  
  @end
  
  
  @implementation UIThumbnailGalleryView
  
  - (id)initWithFrame:(CGRect)frame
  {
      self = [super initWithFrame:frame];
      if (self) {
          [self initView:frame];
  
      }
      return self;
  }
  -(void)initView:(CGRect)frame
  {
      self.collectionView = [[UICollectionView alloc] initWithFrame:self.bounds collectionViewLayout:[self getGalleryLayout]];
  
      [self.collectionView registerClass:[UrlLoadableCollectionViewCell class] forCellWithReuseIdentifier:cellIdentifier];
      self.collectionView.delegate = self;
      self.collectionView.dataSource = self;
      self.collectionView.autoresizingMask = UIViewAutoresizingFlexibleHeight;
      [self addSubview:self.collectionView];
      self.collectionView.backgroundColor = [UIColor blackColor];
      [self.collectionView setShowsHorizontalScrollIndicator:NO];
      [self.collectionView setShowsVerticalScrollIndicator:NO];
  }
  
  
  -(UICollectionViewCell*)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
  {
  
      UrlLoadableCollectionViewCell *cell = [self.dequeueReusableCellAtIndex:indexPath];
  }
  
  -(UrlLoadableCollectionViewCell *)dequeueReusableCellAtIndex:(NSIndexPath *)index
  {
      UrlLoadableCollectionViewCell *cell = (UrlLoadableCollectionViewCell *)[self.collectionView dequeueReusableCellWithReuseIdentifier:cellIdentifier forIndexPath:index];
      return cell;
  }
  
  -(UICollectionViewFlowLayout *)getGalleryLayout
  {
  
          UICollectionViewFlowLayout *galleryLayout = [[UICollectionViewFlowLayout alloc] init];
          [galleryLayout setItemSize:CGSizeMake(77, 77)];
          galleryLayout.minimumInteritemSpacing = 3.0;
          galleryLayout.minimumLineSpacing = 3.0;
          // iOS 6 - might need to uncomment
          //[galleryLayout setSectionInset:UIEdgeInsetsMake(44,5, 44, 5)];
  
      return galleryLayout;
  }
  </code></pre>