Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I came to this site as I had a similar problem. Actually I am doing the exact same thing: I have a viewcontroller with two subviews (all defined in a storyboard with lots of constraints).</p> <p>in the containerviewcontroller in viewDidLoad I am doing the same calls as you do (but I defined the view first):</p> <pre><code>self.myTableViewController = (TodoListViewController *)[[UITableViewController alloc] initWithStyle:UITableViewStylePlain]; self.myTableViewController.tableView = self.myTableView; self.myTableView.delegate = self.myTableViewController; self.myTableView.dataSource = self.myTableViewController; </code></pre> <p>That works for me (I guess, here is your problem: You don't have a navigation controller around it.... and be sure that the outlets of your tableview are really connected in the storyboard.).</p> <p>But the real problem comes after the correct wiring. If you tab into a cell, you probably want to give some cellID to the nextView. As you have defined your tableviewcontroller manually, only your delegate method didSelectRowAtIndexPath gets called, but not the prepareForSegue.</p> <p>I have played around with instantiating the viewcontroller from the storyboard</p> <pre><code>UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"aStoryboard" bundle:nil]; self.myTableViewController = [storyboard instantiateViewControllerWithIdentifier:@"myTableViewID"]; </code></pre> <p>but the segue did not get called. calling it directly (performSegueWithIdentifier:...) did not work as this tableviewcontroller is not managed by a navigation controller. </p> <p>For me it ended up that the prepareForSegue method gets called in the containerViewController which can delegate the calls to its subviewcontrollers.</p> <p><strong>EDIT: Actually the real solution is DON'T.</strong> There is a "Container View" object which can be added to a view and defines a region of a view controller that can include a child view controller. This is what I really wanted to do.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload