title: How to display custom cells that have been defined in interface builder?
body: <p>I am trying to embed custom designed TableView Cells (in interface builder). For starters I am trying to add a few text fields in its own section. I am able to show the custom designed tableview however I am doing something incorrect as it looks all messed up. Also not super clear on how to add additional sections. Can someone guide me to right direction? I tried following: <a href="http://developer.apple.com/library/ios/#documentation/UserExperience/Conceptual/TableView_iPhone/TableViewCells/TableViewCells.html#//apple_ref/doc/uid/TP40007451-CH7-SW20" rel="nofollow noreferrer">http://developer.apple.com/library/ios/#documentation/UserExperience/Conceptual/TableView_iPhone/TableViewCells/TableViewCells.html#//apple_ref/doc/uid/TP40007451-CH7-SW20</a></p>
  
  <p>But got a little lost. </p>
  
  <p>Here is what it looks like:</p>
  
  <p><img src="https://i.stack.imgur.com/mE2e5.png" alt="enter image description here"></p>
  
  <p>This is my setup in interface builder:</p>
  
  <p><img src="https://i.stack.imgur.com/lyH79.png" alt="enter image description here"></p>
  
  <p>This is my code:</p>
  
  <p>header file:</p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  
  @interface SearchTableViewController : UITableViewController
  {
  
  }
  @property (nonatomic, retain) IBOutlet UITableViewCell *priceRanceCell;
  @end
  </code></pre>
  
  <p>implementation:</p>
  
  <pre><code>#import "SearchTableViewController.h"
  
  
  @interface SearchTableViewController ()
  
  @end
  
  @implementation SearchTableViewController
  @synthesize priceRanceCell=_priceRanceCell;
  
  
  
  
  - (id)initWithStyle:(UITableViewStyle)style
  {
      self = [super initWithStyle:style];
      if (self) {
          // Custom initialization
      }
      return self;
  }
  
  
  - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
  {
      self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
      if (self) {
          self.title = NSLocalizedString(@"Some Search", @"Some Search");
          self.tabBarItem.image = [UIImage imageNamed:@"search"];
      }
      return self;
  }
  
  
  
  
  - (void)viewDidLoad
  {
      [super viewDidLoad];
  
      // Uncomment the following line to preserve selection between presentations.
      // self.clearsSelectionOnViewWillAppear = NO;
  
      // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
      // self.navigationItem.rightBarButtonItem = self.editButtonItem;
  }
  
  - (void)viewDidUnload
  {
      [super viewDidUnload];
      // Release any retained subviews of the main view.
      // e.g. self.myOutlet = nil;
  }
  
  - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
  {
      return (interfaceOrientation == UIInterfaceOrientationPortrait);
  }
  
  #pragma mark - Table view data source
  
  - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
  {
  #warning Potentially incomplete method implementation.
      // Return the number of sections.
      return 1;
  }
  
  - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
  {
  #warning Incomplete method implementation.
      // Return the number of rows in the section.
      return 1;
  }
  
  - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  {
      static NSString *CellIdentifier = @"SearchViewCell";
      UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
  
      // Configure the cell...
      NSInteger section = [indexPath section];
  
  
      switch (section) {
          case 0: // First cell in section 1
  
  
              return self.priceRanceCell;
  
  
              break;
          default:
              // Do something else here if a cell other than 1,2,3 or 4 is requested
  
              return cell;
  
              break;
      }
  
  
  
  
  
  
  
  
      return cell;
  }
  
  /*
  // Override to support conditional editing of the table view.
  - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
  {
      // Return NO if you do not want the specified item to be editable.
      return YES;
  }
  */
  
  /*
  // Override to support editing the table view.
  - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
  {
      if (editingStyle == UITableViewCellEditingStyleDelete) {
          // Delete the row from the data source
          [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
      }   
      else if (editingStyle == UITableViewCellEditingStyleInsert) {
          // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
      }   
  }
  */
  
  /*
  // Override to support rearranging the table view.
  - (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath
  {
  }
  */
  
  /*
  // Override to support conditional rearranging of the table view.
  - (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath
  {
      // Return NO if you do not want the item to be re-orderable.
      return YES;
  }
  */
  
  #pragma mark - Table view delegate
  
  - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
  {
      // Navigation logic may go here. Create and push another view controller.
      /*
       &lt;#DetailViewController#&gt; *detailViewController = [[&lt;#DetailViewController#&gt; alloc] initWithNibName:@"&lt;#Nib name#&gt;" bundle:nil];
       // ...
       // Pass the selected object to the new view controller.
       [self.navigationController pushViewController:detailViewController animated:YES];
       */
  }
  
  @end
  </code></pre>