user3477147
user3477147

Reputation: 21

Reload TableView data after poping up viewcontroller

I have a following set up:

The third view controller is a push segue where I want to insert all client informations. After I click "Dodaj" it saves all data into CoreData and pops the current view. Unfortunatelly it doesn't reload data in TableViewController. If I go back and click again on menu to get to the TableViewController data are reloaded.

I need it to reload before the last ViewController pops. Any help?

I've already tried

[self.navigationController popViewControllerAnimated:YES];
    [self.navigationController popToViewController:[self.navigationController.viewControllers objectAtIndex:1] animated:YES];

to pop view controller. I don't know how to reload data using [self.tableView reloadData] in another viewcontroller. Please help!

Best, Bartosz

Upvotes: 2

Views: 1662

Answers (1)

Rick
Rick

Reputation: 1818

If you always need to reload data in a tableview in any view controller, the easiest is to add [self.tableView reloadData] in viewWillAppear.

If you want to selectively reload data, find out more on using delegates.

Upvotes: 2

Related Questions