Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Refresh Container View on Button Press

I have a UIViewController with a container view which holds a UITableView.

Within the UITableView I have a NSFetchController with NSPredicate that uses variables from the intial UIViewcontroller (I hope your still with me). For one instance that the user changes the container view does not update.

How can I force a reload/update on the container view when this occurs? I looked around but did not see much on this topic.

To be specific I have a UIDatePicker that changes the date on a button. It is this that needs to be updated.

enter image description here

like image 420
memyselfandmyiphone Avatar asked Jul 11 '13 19:07

memyselfandmyiphone


1 Answers

From the initial UIView controller, you can get a reference to the table view controller with self.childViewControllers[0]. So, you need to do it like this:

UITableViewController *tbc = (UITableViewController *)self.childViewControllers[0];
[tbc.tableView reloadData];
like image 143
rdelmar Avatar answered Oct 17 '22 01:10

rdelmar