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.