title: How to avoid UICollectionView repeating cells?
body: <p>Hello I have a <code>UICollectionView</code>. I load data from a <code>NSMutableArray</code> and it has 4 objects. But my problem is its repeating the same cells again.</p>
  
  <p>`</p>
  
  <pre><code>- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
  return mutArrayArtists.count;
  }
  
  
  
  - (NSInteger)numberOfSectionsInCollectionView: (UICollectionView *)collectionView {
  return 2;
   }
  
  
  
  - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView  cellForItemAtIndexPath:(NSIndexPath *)indexPath{
  static NSString *identifier = @"Cell";
  
  UICollectionViewCell *cell = [collectionView   dequeueReusableCellWithReuseIdentifier:identifier forIndexPath:indexPath];
  
  artist = [mutArrayArtists objectAtIndex:indexPath.row];
  UIImageView *recipeImageView = (UIImageView *)[cell viewWithTag:100];
  recipeImageView.image = artist.artistImage;
  
  UILabel *lblArtistname=(UILabel *)[cell viewWithTag:102];
  lblArtistname.text=artist.artistName;
  
  UILabel *lblSongCount=(UILabel *)[cell viewWithTag:101];
  lblSongCount.text=artist.numberofSongs;
  return cell;
   }
  </code></pre>
  
  <p>`</p>
  
  <p>But the result is like this
  <img src="https://i.stack.imgur.com/DBUXB.png" alt="enter image description here"></p>
  
  <p>How can I avoid this? Please help me</p>
  
  <p>Thanks</p>