title: How to programmatically add ChildVC?
body: <p>I have storyboard:
  <img src="https://i.stack.imgur.com/4WHFs.png" alt="myStoryBoard"></p>
  
  <p>As you can see i have <strong>MenuViewController : UIViewController</strong> with container. Container is
  <strong>MenuTableViewController : UITableViewController</strong>
  with <strong>MenuTableView : UITableView</strong>.</p>
  
  <p>What I want to do is change size of my Container (MenuTableViewController) and add another Child to my mainVC.</p>
  
  <p>I add it in MenuViewController:</p>
  
  <pre><code>-(void)viewDidAppear:(BOOL)animated {
  
      UIStoryboard *sb = [UIStoryboard storyboardWithName:@"MainStoryboard_iPhone" bundle:nil];
      MenuTableViewController* secondChildVC = [sb instantiateViewControllerWithIdentifier:@"MenuTableViewController"];
      [secondChildVC.view setBackgroundColor:[UIColor redColor]];
      [self addChildViewController:secondChildVC];
      NSLog(@"MenuTableViewController.view info: %@",secondChildVC.view);
      NSLog(@"secondChildVC views: %@",[secondChildVC.view subviews]);
  
      MenuTableViewController *firstChildVC = [self.childViewControllers objectAtIndex:0];
      [firstChildVC.view setFrame:CGRectMake(160, 0, 160, 504)];
      [firstChildVC.view setBackgroundColor:[UIColor greenColor]];
      NSLog(@"firstChildVC views: %@",[firstChildVC.view subviews]);
  
  }
  </code></pre>
  
  <p>And this is my log:</p>
  
  <pre><code>MenuTableViewController.view info: &lt;MenuTableView: 0x8910e00; baseClass = UITableView; frame = (0 20; 320 548); clipsToBounds = YES; opaque = NO; autoresize = W+H; gestureRecognizers = &lt;NSArray: 0x761eca0&gt;; layer = &lt;CALayer: 0x76202b0&gt;; contentOffset: {0, 0}&gt;
  2013-05-03 17:20:10.796 TestStories[41780:c07] secondChildVC views: (
      "&lt;UIImageView: 0x76205e0; frame = (0 541; 320 7); alpha = 0; opaque = NO; autoresize = TM; userInteractionEnabled = NO; layer = &lt;CALayer: 0x7620680&gt;&gt;",
      "&lt;UIImageView: 0x7620740; frame = (313 517; 7 7); alpha = 0; opaque = NO; autoresize = LM; userInteractionEnabled = NO; layer = &lt;CALayer: 0x76207e0&gt;&gt;"
  )
  2013-05-03 17:20:10.798 TestStories[41780:c07] firstChildVC views: (
      "&lt;UITableViewCell: 0x7143110; frame = (0 320; 160 320); autoresize = W; layer = &lt;CALayer: 0x713cc10&gt;&gt;",
      "&lt;UITableViewCell: 0x7140b90; frame = (0 0; 160 320); autoresize = W; layer = &lt;CALayer: 0x7140ce0&gt;&gt;",
      "&lt;UIImageView: 0x7135000; frame = (0 497; 320 7); alpha = 0; opaque = NO; autoresize = TM; userInteractionEnabled = NO; layer = &lt;CALayer: 0x71351b0&gt;&gt;",
      "&lt;UIImageView: 0x7135270; frame = (153 517; 7 7); alpha = 0; opaque = NO; autoresize = LM; userInteractionEnabled = NO; layer = &lt;CALayer: 0x7135310&gt;&gt;"
  )
  </code></pre>
  
  <p>Why my secondChildVC does not contain TableViewCells? No idea.</p>
  
  <p>You can see that i use red and green colors for background (red for secondChildCV). But probably never appears. Here is screenshot:
  <img src="https://i.stack.imgur.com/bKGl3.png" alt="enter image description here"></p>