title: UICollectionview Sections/Rows/Array
body: <p>I'm trying to do something with an UICollectionView. I want them centered in the middle, but therefor i need to create something like this:</p>
  
  <pre><code>(Array consists of 5 items)
  X X &lt;- 2 items in section 1
  X X &lt;- 2 items in section 2
  X   &lt;- 1 item in section 3
  </code></pre>
  
  <p>But the problem is that the items doesn't show up right? If i would have 3 items. The items would be like, In section 1, item 1 and 2. and then in section 2 would be item 1 again, instead if item 3 of my array.</p>
  
  <p>This is my code:</p>
  
  <pre><code>- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
      float uitkomst = ceilf((float)[arrayDobbel count] / 2) - 1; // Array starts at 0 so need to do - 1
  
      if (uitkomst == section) {
          return 1; // Last cell
      }
      return 2; //Always 2 cells to each other, not the last section
  }
  
  - (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView{
      float uitkomst = ceilf((float)[arrayDobbel count] / 2); //Calculate how much sections. Always 2 items / section
  
      return (int)uitkomst;
  }
  
  - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
  
      detailDice *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"dobbelsteenGame" forIndexPath:indexPath];
  
      cell.layer.cornerRadius = 25;
      cell.layer.backgroundColor = [[UIColor colorWithRed:0.188 green:0.341 blue:0.612 alpha:1.0] CGColor];
      [[cell detaildiceLabel] setText: [NSString stringWithFormat:@"%@", [[arrayDobbel objectAtIndex:indexPath.row] returnRandomOptie]]];
  
      return cell;
  }
  </code></pre>
  
  <p>Could anyone help me with the display of the right texts in the right cells?</p>
  
  <p>Kind Regards</p>