title: Is there any way to instantiate a prototype UITableViewCell from a storyboard for testing?
body: <p>I'm using a combination of <code>XCTest</code> and <code>OCMock</code> for testing an iOS application. I'm using a <code>UITableViewController</code> to present a series of prototype cells which I would like to write some tests for. The cell itself is in a storyboard so I don't believe I can instantiate it from a nib.</p>
  
  <p>Is the only option to use the <code>viewController</code> which uses the cell to instantiate it?</p>
  
  <p>The custom cell class I'm using has a number of 'IBOutlets' connected to the prototype on the storyboard. The cell class looks something like this:</p>
  
  <pre><code>@interface QRFeedAdCell : UITableViewCell
  
  @property (strong, nonatomic) IBOutlet UIImageView *mainImageView;
  @property (strong, nonatomic) IBOutlet UIImageView *blurredImageView;
  @property (strong, nonatomic) IBOutlet UILabel *titleLabel;
  @property (strong, nonatomic) IBOutlet UIButton *someButton;
  @property (strong, nonatomic) IBOutlet UILabel *someLabel;
  @property (strong, nonatomic) IBOutlet UILabel *anotherLabel;
  @property (nonatomic) BOOL isBusy;
  
  @end
  </code></pre>
  
  <p>I've tried instantiating the cell using <code>[[QRFeedAdCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"feedAdCell"];</code> but that will load the cell with all of the properties set to nil.</p>
  
  <p>I've also tried registering the cell, but the tests also fail:</p>
  
  <pre><code> id mockTableView = [OCMockObject niceMockForClass:[UITableView class]];
  [mockTableView registerClass:[QRFeedAdCell class] forCellReuseIdentifier:@"feedAdCell"];
  
  QRFeedAdCell *cell = [mockTableView dequeueReusableCellWithIdentifier:@"feedAdCell"];
  
  XCTAssertNotNil(cell, @"");
  XCTAssertNotNil(cell.mainImageView, @"");
  </code></pre>