When you call the
[[self navigationController] popToRootViewControllerAnimated:NO];
the navigationController will try to pop all view controllers and show the topview controller, the following codes will not be called.
You should consider handling the viewWillAppear method of the topViewController for any modifications and reloading of data.
This is an example of what you can do with viewWillAppear on the sample application iPhoneCoreDataRecipes That sample application will give you an overview of view controller's lifecycles, etc...
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[photoButton setImage:recipe.thumbnailImage forState:UIControlStateNormal];
self.navigationItem.title = recipe.name;
nameTextField.text = recipe.name;
overviewTextField.text = recipe.overview;
prepTimeTextField.text = recipe.prepTime;
[self updatePhotoButton];
/*
Create a mutable array that contains the recipe's ingredients ordered by displayOrder.
The table view uses this array to display the ingredients.
Core Data relationships are represented by sets, so have no inherent order. Order is "imposed" using the displayOrder attribute, but it would be inefficient to create and sort a new array each time the ingredients section had to be laid out or updated.
*/
NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"displayOrder" ascending:YES];
NSArray *sortDescriptors = [[NSArray alloc] initWithObjects:&sortDescriptor count:1];
NSMutableArray *sortedIngredients = [[NSMutableArray alloc] initWithArray:[recipe.ingredients allObjects]];
[sortedIngredients sortUsingDescriptors:sortDescriptors];
self.ingredients = sortedIngredients;
[sortDescriptor release];
[sortDescriptors release];
[sortedIngredients release];
// Update recipe type and ingredients on return.
[self.tableView reloadData];
}