I have a navigation based application which has multiple views (Say root <- A <- B <- C). What I want to do is that when users pop out of the top most view (C) to view B, automatically execute some checks in view B and if met, go to view A.
What I did is the following:
In class B which is a UITableViewController
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
BOOL completed = NO;
// The logic that sets completed is here
if (completed)
{
// OK I want to pop out to the previous view controller (A)
[self.navigationController popViewControllerAnimated:YES];
}
}
}
What happens is that the debug stops telling me that navigationController has already been deallocated. Not so sure why
Any ideas?