title: How to initialize a custom prototype style table cell in iOS 5 storyboards?
body: <p>I am converting over to iOS 5 and storyboards. When I have a table view with default cell style, everything works fine.</p>
  
  <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
      UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MyIdentifierFromStoryboard"];
      if (cell == nil) {
          cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"MyIdentifierFromStoryboard"];
      }
      return cell;
  }
  </code></pre>
  
  <p>I have seen examples where the "if (cell == nil)" block is removed. However if I take it out, my app crashes with the message: "UITableView dataSource must return a cell from tableView:cellForRowAtIndexPath:". This is not a problem because it works as shown above.</p>
  
  <p>My problem is that I want to use a custom style for the cell and thus cannot use initWithStyle. How do I initialize a custom cell that I have designed on the storyboard?</p>
  
  <p>The old pre-5 app had a nib and class that used something like this, but now I'm using the storyboard.</p>
  
  <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
      MyCustomTableCell *cell = (MyCustomTableCell *) [tableView dequeueReusableCellWithIdentifier:@"MyCustomIdentifier"];
      if (cell == nil) {
          NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"MyCustomTableCell" owner:self options:nil];
          cell = (MyCustomTableCell *) [nib objectAtIndex:0];
      }
      return cell;
  }
  </code></pre>