title: Add UITableViewController to Current View Programmatically
body: <p>I need to display UITableViewController programmatically from existing view.</p>
  
  <p>I have a MyAppViewController and the button on its view should open a new UITableViewController. But I cannot seem to get it working so far. Here is how UITableViewController looks like:</p>
  
  <pre><code>@interface SecondViewController : UITableViewController{}
  </code></pre>
  
  <p>and on the main view I add table view controller using the following:</p>
  
  <pre><code>SecondViewController vc2 = [[SecondViewController alloc] init];
  vc2.view.frame = {...}
  [self.view addSubview: vc2.view];
  </code></pre>
  
  <p>This is how I would normally add a simple view controller so I thought UITableViewController is the same. </p>
  
  <p>The result I get is empty cells on the entire screen. This is because of the delegate not set, I assume, but where would I set it? So my confusion is the delegate setters on UITableViewController view controller and displaying UITableViewController correctly from the main view controller's view.</p>