title: UICollectionView showing empty cells
body: <p>I have a <code>UICollectionView</code> that displays an array of images. The images in the cell are being displayed as white boxes instead of the real image.</p>
  
  <p>I copied and pasted this code from another view and it works great in the other view... but somehow in this other view its displaying all images like a white box.  </p>
  
  <p>The boxes shown are equal to the number of images that should be displayed. So the information is passed correctly.</p>
  
  <p>The images are being displayed like litte white boxes but when I click on them they then display the selected image into another <code>UIImage</code> element that i placed somewhere else (see image1, the green square to the left of the clear button changes depending on which white cellIi touch).</p>
  
  <p>Could anyone spot why is the <code>UIImage</code> in the Cell not displaying properly?</p>
  
  <p>maybe is worth metioning that i also have a tableview in the same view</p>
  
  <pre><code>// in viewDidLoad method
  [self.myCollection registerClass:[UICollectionViewCell class] forCellWithReuseIdentifier:@"Cells"];
  
  //
  - (void)getAllIcons
  {        
      NSArray* imgArrayRaw = [[NSBundle mainBundle] pathsForResourcesOfType:@"png" inDirectory:nil];
  
      NSMutableArray* imgArray = [[NSMutableArray alloc] init];
      for (NSString* imgArrayProccesing in imgArrayRaw) {
          NSString* ho = [imgArrayProccesing lastPathComponent];
          if([ho rangeOfString:@"btn-"].location != NSNotFound){
              [imgArray addObject:ho];
          }
      }
      _imgFiles = [ NSMutableArray arrayWithObjects:imgArray,nil];
      _imgFiles = _imgFiles[0];
  
  
      _myCollection.hidden = NO;
      [_myCollection reloadData];
  }
  
  // Collection View
  #pragma mark - UICollectionView Datasource
  
  - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
  {   
      return [_imgFiles count];
  }
  
  - (NSInteger)numberOfSectionsInCollectionView: (UICollectionView *)collectionView
  {
      return 1;
  }
  
  - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
  {   
      UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"Cells" forIndexPath:indexPath];
  
      UIImageView *imageView = (UIImageView *)[cell viewWithTag:101]; 
      imageView.image = [UIImage imageNamed:[_imgFiles objectAtIndex:indexPath.row]]; 
      cell.backgroundColor = [UIColor whiteColor];
  
      return cell;
  }
  
  - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
  {
      [self changeIconImage:[_imgFiles objectAtIndex:indexPath.row]]; 
  }
  
  - (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath
  {   
      return CGSizeMake(50, 50);  
  }
  
  - (UIEdgeInsets)collectionView:
  (UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout insetForSectionAtIndex:(NSInteger)section
  {   
      return UIEdgeInsetsMake(50, 20, 50, 20);
  }
  </code></pre>
  
  <p>Image1:
  <img src="https://i.stack.imgur.com/sCkz6.png" alt="image 1">
  <img src="https://i.stack.imgur.com/j0ZAT.png" alt="enter image description here">
  <img src="https://i.stack.imgur.com/ZRTAt.png" alt="enter image description here"></p>