title: iOS -- missing something adding a custom UICollectionViewCell to a UICollectionView
body: <p>Im trying to define my own custom <code>UICollectionViewCell</code> implementation and use it in a <code>UICollectionView</code>.  Here is what I have done.</p>
  
  <p>1-  I am using storyboards.</p>
  
  <p>2-  I added a <code>UICollectionView</code> to another view, that was a scene on the storyboard.  </p>
  
  <p>3-  I pointed <code>datasource</code> and <code>delegate</code> of the collection to the controller for the scene.</p>
  
  <p>4-  I provided implementations of the required methods in the controller.</p>
  
  <p>5-  I created a cell view <code>.h</code> and <code>.m</code> file.  In the <code>.h</code> file I do </p>
  
  <p><code>@interface HscCellView : UICollectionViewCell</code></p>
  
  <p>6-  I created a new view, so I got a new canvas, and in the appropriate section on the right I specified my class name (same as in step 5), and provided a unique identifier.<br>
  7-  In the controller for the scene, I defined an outlet in the .h file to the collection view I had dragged in. </p>
  
  <p><code>@property (nonatomic, strong) IBOutlet UICollectionView   *holesCollectionView;</code> </p>
  
  <p>and in <code>viewDidLoad</code> I do </p>
  
  <pre><code>[self.holesCollectionView registerClass:[HscCellView class] forCellWithReuseIdentifier:@"cellView"];
  </code></pre>
  
  <p>note that <code>cellView</code> is the unique identifier I specified for my custom cell xib.</p>
  
  <p>8- Finally, I implemented </p>
  
  <pre><code>- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
  {
      HscCellView *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"cellView" forIndexPath:indexPath];
  
      return cell;
  
  }
  </code></pre>
  
  <p>When I fire up the app, I get a bunch of cell views (9, since I specify 9 on the <code>numberOfItemsInSection</code> message) but they are not my custom cell view.  They don't have the size, color, or label.  I'm not seeing any errors. I'm stuck.  </p>
  
  <p>A few ancillary questions.</p>
  
  <ul>
  <li><p>When do I use register the nib and when do I  register the class name?  I've seen it done both ways, but it seems that you pretty much always end up with both a nib and a class definition code, is that true?.</p></li>
  <li><p>In step 6, when I specify the unique id in the canvas for the custom cell view, does that mean I don't need to register the class in <code>viewDidLoad</code>?</p></li>
  </ul>