Just you simply have a public method in your UITableViewController
and execute it by UIViewController
. Let’s assume that your UITableViewController
has the following method in its header:
- (void)preencheTabela:(NSArray *)lista;
And the implementation:
- (void)preencheTabela:(NSArray *)lista {
// TODO preencher sua lista atual com a recuperada
[self.tableView reloadData];
}
And in his UIViewController
, once you have the reference of the Controller
with the table that was inserted in container, just run your method:
[self.referanciaTabela preencheTabela:listaEnviada];
Clarifying that it is not for the container that you will pass, and yes to the Controller
that’s inside the container. It was clear?
Your reference, already with the container added from the storyboard, is more or less like this, in the viewDidLoad:
for example:
self.referanciaTabela = [self.childViewControllers firstObject];
Yes, I understood, but my doubt is that she is already created via storyboard, so she is automatically already inside this container. So I don’t have my container controller instantiated in my Uiviewcontroller
– Gian
Okay, no problem since you just get the reference on
viewDidLoad:
with the first element ofchildViewControllers
. I added an edit to my reply.– Paulo Rodrigues
Thanks, it worked out here, first time working with Container View I was a little bit scared
– Gian