title: Select items programmatically in UICollectionView
body: <p>I have a <code>UICollectionViewController</code>:</p>
  
  <pre><code>- (NSInteger)collectionView:(UICollectionView *)collectionView 
       numberOfItemsInSection:(NSInteger)section {
      return [self.pageTastes count];
  }
  
  - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView  
                    cellForItemAtIndexPath:(NSIndexPath *)indexPath {
       CellTasteCollectionView *cell = 
         [collectionView dequeueReusableCellWithReuseIdentifier:@"Cell" 
                                                   forIndexPath:indexPath];
       Taste *taste = [self.pageTastes objectAtIndex:indexPath.item];       
       [[cell imageView] setImage:taste.image];
       [cell setObjectId:taste.objectId];    
       return cell;
  }
  </code></pre>
  
  <p>It works. I have this in <code>viewDidLoad</code>, allowing the user to choose multiple items:</p>
  
  <pre><code>[self.collectionView setAllowsMultipleSelection:YES];
  </code></pre>
  
  <p>What I want to have, is that the first time the CollectionView loads, some items get selected programmatically, based on their <code>objectId</code> in <code>CellTasteCollectionView</code>.</p>
  
  <p>Here's how I'm doing this:</p>
  
  <pre><code>- (void)collectionView:(UICollectionView *)collectionView 
           didSelectItemAtIndexPath:(NSIndexPath *)indexPath{
  
      Taste *taste = [self.pageTastes objectAtIndex:indexPath.item];
      printf("%s\n", [taste.objectId UTF8String]);
  }
  </code></pre>
  
  <p>It's called when the user clicks on the item -- this is not what I want: I want the item to be selected automatically when <code>UICollectionView</code> loads.</p>
  
  <p>How do I do this?</p>