title: tableView not found on object of type
body: <p>I have a class named FirstViewController which is a subclass of UIViewController and I have a UITableView in the class. I need to transition from this class to a new UIViewController subclass (using segues) when a row is pressed. </p>
  
  <p>I have made the FirstViewController the UITableViewDelegate and UITableViewDataSource using the code -</p>
  
  <pre><code>@interface FirstViewController : UIViewController &lt;UITableViewDataSource, UITableViewDelegate&gt;
  </code></pre>
  
  <p>I am getting an error on this line of code - </p>
  
  <pre><code>NSIndexPath *path = [self.tableView indexPathForSelectedRow];
  </code></pre>
  
  <p>How do I fix this problem since the tableView is found in UITableViewController and not in UIViewController class ?</p>
  
  <p>Edit - </p>
  
  <p>Here's the code related to my table view -</p>
  
  <pre><code>- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
  
      return [sarray count];
  }
  
  - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
  
      static NSString *cellId = @"Cell";
      UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId];
  
      if(cell == nil){
          cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellId];
      }
  
      NSString *text = [sarray objectAtIndex:[indexPath row]];
      cell.textLabel.text = text;
      return cell;
  }
  </code></pre>