I have my storyboard set up like this:
V1ViewController
UITableViewController
with a set of static cellsI'm trying to access the text box in the Left Detail from the code in V1ViewController
, but can't seem to figure out how to traverse that hierarchy. Any help would be appreciated.
This is the proper way to get a reference to your child view controller:
- (void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([segue.identifier isEqualToString: @"childViewControllerSegue"]) {
ChildViewController *myChildViewController = (ChildViewController *) [segue destinationViewController];
//With myChildViewController you can access your child view controller for example:
[myChildViewController.myTableView reloadData];
}
}
Keep in mind that because this is a Container view this method will be called upon load of your ViewController
. Therefore it would be a good idea to save myChildViewController
as a property or an instance variable for later use.