Inferis/ViewDeck — Issue #31: viewWillAppear not being called
Author: sleaveruk
Created: 2012-02-04 18:54:35+00:00
State: open

In my app, when I change the centre view controller the above method is not being called and I can't work out why. I've looked at all your examples, when the tab bar one in your development branch and they all call the method and I can't see why mine doesn't!

It's probably a really stupid issue with an extremely simple answer but the code I'm using to change the center view controller is:

```
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
if (indexPath.row == COMBINED) {
[self.viewDeckController closeLeftViewBouncing:^(IIViewDeckController *controller) {
CombinedNewsViewController *newsCombinedList = [[CombinedNewsViewController alloc] initWithNibName:@"CombinedNewsViewController" bundle:nil];
UINavigationController* navController = [[UINavigationController alloc] initWithRootViewController:newsCombinedList];
self.viewDeckController.centerController = navController;
}];
} else if (indexPath.row == SOURCES) {
NewsFeedListViewController *newsFeedList = [[NewsFeedListViewController alloc] initWithNibName:@"NewsFeedListViewController" bundle:nil];
[self.viewDeckController closeLeftViewBouncing:^(IIViewDeckController *controller) {
UINavigationController* navController = [[UINavigationController alloc] initWithRootViewController:newsFeedList];
self.viewDeckController.centerController = navController;
}];
}
}
```

If it makes any difference, viewDidLoad is called! However I also need viewWillAppear!