title: iOS: indexPath.row, UICollectionView, and Images
body: <p>I am trying to display through a <code>UICollectionView</code> only 9 pictures in my main iphone screen. But I have a problem with the displaying. My first picture is always repeated 2 times (in position 1 and position 2 of the row 1).</p>
  
  <p>Something wrong in my code ?</p>
  
  <pre><code>// Define the number of Cell.
  - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
  
  return  9; }
  
  
  // The cell that is returned must be retrieved from a call to -dequeueReusableCellWithReuseIdentifier:forIndexPath:
  - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
  
      static NSString *IdCell = @"Cell";
  
       SSCollectionViewCell *cell = (SSCollectionViewCell *) [collectionView dequeueReusableCellWithReuseIdentifier: IdCell forIndexPath: indexPath];
      int imageNumber = indexPath.row % 9;
  
      cell.imageView.image = [UIImage imageNamed: [NSString stringWithFormat:@"M2_img_%d@2x.png", imageNumber]];
  
      return cell;
  
      }
  </code></pre>