title: How to get a custom UITableViewCell class created in IB to load into a UITableView?
body: <p>I am new to this so please bear with me:</p>
  
  <p>I have a .xib in IB containing a UIScrollView that has a UITableView embedded in it.  I would like to load custom UITableViewCells into the UITableView.  I have four/five custom cells created in IB but cannot get the first to load correctly.</p>
  
  <p>Here are relevant screenshots from IB:</p>
  
  <p><img src="https://i.stack.imgur.com/V7Ovt.png" alt=".xib">
  <img src="https://i.stack.imgur.com/tVITQ.png" alt="custom cell &quot;itemCell&quot;"></p>
  
  <p>I have set the class for the custom UITableViewCell created in IB to the UITableView class I created called "itemCell".  Additionally, I have connected the three text fields outlets and delegates to "itemCell".</p>
  
  <p>Here is itemCell.h:</p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  
  @interface itemCell : UITableViewCell
  @property (weak, nonatomic) IBOutlet UITextField *quantityTextField;
  @property (weak, nonatomic) IBOutlet UITextField *itemTextField;
  @property (weak, nonatomic) IBOutlet UITextField *priceTextField;
  
  @end
  </code></pre>
  
  <p>Here is itemCell.m:</p>
  
  <pre><code>#import "itemCell.h"
  
  @implementation itemCell
  @synthesize quantityTextField,itemTextField,priceTextField;
  
  - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
  {
      self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
      if (self) {
          // Initialization code
  
      }
      return self;
  }
  
  - (void)setSelected:(BOOL)selected animated:(BOOL)animated
  {
      [super setSelected:selected animated:animated];
  
      // Configure the view for the selected state
  }
  
  @end
  </code></pre>
  
  <p>In filecontroller.m, which is the rootcontroller .xib's implementation file I create a new cell based on the user pressing a button (add it to an array) and then reload the tableview.  I am getting no errors but I am getting a normal cell loaded in rather than what I have created in IB. Here is rootcontroller.m.  Any help is appreciated.</p>
  
  <pre><code>- (void)viewDidLoad
  {
      [super viewDidLoad];
      // Do any additional setup after loading the view, typically from a nib.
      scrollView =(UIScrollView *)self.view;
      items = [[NSMutableArray alloc] init];
  }
  
  - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
      return [items count];
  }
  
  
  - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
          return [items objectAtIndex:[indexPath row]];
  }
  
  - (UITableViewCell *)initiateNewCell{
      itemCell *cell = [[itemCell alloc] init];
      cell.accessoryType = UITableViewCellAccessoryNone;
      cell.selectionStyle = UITableViewCellSelectionStyleBlue;
      return cell;
  }
  
  - (IBAction)addItem:(id)sender {
      //creates the new cell to be added
      [items addObject:[self initiateNewCell]];
      [self.tableView reloadData];
  </code></pre>