title: Trying to load UIViewController after click of item in TableViewController
body: <p>I feel like this is a fairly easy question, but I've tried for hours and can't seem to get it.  I'm trying to create an app that calculates different equations that are critical to my job.  Essentially, I've grouped the calculations into categories using nested TableViewControllers.  This part works.  </p>
  
  <p>The part I am trying to figure out is how to push to a UIViewController so I can actually have the user enter data to do the calculations.  For some reason I can't seem to get it to work.  I am using Xcode 5 and am using Storyboards.</p>
  
  <p>Really sorry for the long post.  I've also included a screenshot of the storyboard at the following link: <a href="http://imgur.com/0oSxsR1" rel="nofollow">http://imgur.com/0oSxsR1</a></p>
  
  <p>code below:</p>
  
  <p><strong>Root TableViewController Code (RootTableViewController.m)</strong></p>
  
  <pre><code>#import "RootTableViewController.h"
  #import "calculatorTableViewController.h"
  
  @interface RootTableViewController ()
  
  @end
  
  @implementation RootTableViewController{
      NSArray *calculatorOptions;
  }
  
  - (id)initWithStyle:(UITableViewStyle)style
  {
      self = [super initWithStyle:style];
      if (self) {
          // Custom initialization
      }
      return self;
  }
  
  - (void)viewDidLoad
  {
      [super viewDidLoad];
      calculatorOptions = [NSArray arrayWithObjects: @"General", @"Digital", @"Print", @"Television", nil];
  
  }
  
  - (void)didReceiveMemoryWarning
  {
      [super didReceiveMemoryWarning];
      // Dispose of any resources that can be recreated.
  }
  
  #pragma mark - Table view data source
  
  - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
  {
      // Return the number of sections.
      return 1;
  }
  
  - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
  {
      // Return the number of rows in the section.
      return [calculatorOptions count];
  }
  
  
  - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  {
      static NSString *simpleTableIdentifier = @"CalculatorCell";
  
      UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier];
  
      // Configure the cell...
  
      if (cell == nil) {
          cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:simpleTableIdentifier];
      }
      cell.textLabel.text = [calculatorOptions objectAtIndex:indexPath.row];
      return cell;
  }
  
  - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{
  
      if ([segue.identifier isEqualToString:@"calculatorDetails"]){
          NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
          calculatorTableViewController *destViewController = segue.destinationViewController;
          destViewController.calculationType = [calculatorOptions objectAtIndex:indexPath.row];
          destViewController.title = destViewController.calculationType;
      }
  
  }
  
  
  @end
  </code></pre>
  
  <p><strong>Secondary TableViewController.h file (calculatorTableViewController.h)</strong></p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  
  @interface calculatorTableViewController : UITableViewController
  
  @property (nonatomic, strong) NSString *calculationType;
  
  
  @end
  </code></pre>
  
  <p><strong>Secondary TableViewController.m file (calculatorTableViewController.m)</strong></p>
  
  <pre><code>#import "calculatorTableViewController.h"
  #import "CalculateGrpsHaveRF.h"
  
  
  @interface calculatorTableViewController ()
  
  @end
  
  @implementation calculatorTableViewController{
      NSArray *general;
      NSArray *digital;
      NSArray *print;
      NSArray *television;
  }
  
  - (id)initWithStyle:(UITableViewStyle)style
  {
      self = [super initWithStyle:style];
      if (self) {
          // Custom initialization
      }
      return self;
  }
  
  - (void)viewDidLoad
  {
      [super viewDidLoad];
      general = [NSArray arrayWithObjects:@"Calculate GRPs (Have R &amp; F)", @"Calculate Reach (Have GRPs &amp; F)", @"Calculate Frequency (Have GRPs &amp; R)", @"CPM to CPP", @"CPP to CPM", nil];
  
      digital = [NSArray arrayWithObjects:@"Calculate Impressions (Have cost &amp; CPM)", @"Calculate CPM (Have cost &amp; impressions)", @"Calculate Cost (Have CPM and Impressions)", @"Calculate ASF", @"Calculate CPC/CPA/CPV", nil];
  
      print = [NSArray arrayWithObjects:@"Calculate CPM", @"Calculate GRPs", @"Calculate CPP", nil];
  
      television = [NSArray arrayWithObjects:@"Universe Estimates", @"Calculate GRPs", @"Calculate Spots", @"Calculate Average Rating", @"Calculate Total Impressions", @"Calculate CPP", nil];
  
  }
  
  - (void)didReceiveMemoryWarning
  {
      [super didReceiveMemoryWarning];
      // Dispose of any resources that can be recreated.
  }
  
  #pragma mark - Table view data source
  
  - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
  {
      // Return the number of sections.
      return 1;
  }
  
  - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
  {
      if ([_calculationType isEqualToString:@"General"]){
          return [general count];
      }
      else if ([_calculationType isEqualToString:@"Digital"]){
          return [digital count];
      }
      else if ([_calculationType isEqualToString:@"Print"]){
          return [print count];
      }
      else if ([_calculationType isEqualToString:@"Television"]){
          return [television count];
      }
      return 0;
  }
  
  
  - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  {
      static NSString *simpleTableIdentifier = @"Calculator2Cell";
  
      UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier];
  
      // Configure the cell...
  
      if (cell == nil) {
          cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:simpleTableIdentifier];
      }
  
      if ([_calculationType isEqualToString:@"General"]) {
          cell.textLabel.text = [general objectAtIndex:indexPath.row];
          cell.textLabel.font = [UIFont systemFontOfSize:12];
      }
  
      else if ([_calculationType isEqualToString:@"Digital"]) {
          cell.textLabel.text = [digital objectAtIndex:indexPath.row];
          cell.textLabel.font = [UIFont systemFontOfSize:12];
      }
  
      else if ([_calculationType isEqualToString:@"Print"]) {
          cell.textLabel.text = [print objectAtIndex:indexPath.row];
          cell.textLabel.font = [UIFont systemFontOfSize:12];
      }
  
      else if ([_calculationType isEqualToString:@"Television"]) {
          cell.textLabel.text = [television objectAtIndex:indexPath.row];
          cell.textLabel.font = [UIFont systemFontOfSize:12];
      }
  
      return cell;
  }
  
  
  -(void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
  
  
  }
  
  
  - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
  if ([segue.identifier isEqualToString:@"Calculate GRPs (Have R &amp; F)"]) {
      NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
      CalculateGrpsHaveRF *destViewController = segue.destinationViewController;
      destViewController.Title = [general objectAtIndex:indexPath.row];
  
  
  @end
  </code></pre>