Reload Data of UITableView After going 'Back'
Let's say you are editing data on phone, and after you are done with your edit you are clicking the Save button, and programmatically returning back to the ViewController you were in before with:
[self.navigationController popViewControllerAnimated:YES];
But, if you do this, and you are depending on the changed data, It won't change until you make changes to the root ViewController's viewWillAppear:animated method.
I was always using viewDidLoad instead of viewWillAppear. And most of the times it gave me the results that I expect.
But, the thing about viewDidLoad is that it's being called just once, when the ViewController is being initialized for the first time. But viewWillAppear will be called every time you open that ViewController.
So, as a solution to reload data every time when a ViewController shows up, you can use:
- (void)viewWillAppear:(BOOL)animated { [self.tableView reloadData]; [super viewWillAppear:animated]; }