I struggled with switching between views using the UINavigationalController. I used this system many times without problems, but in my new application it does not work correctly.
Here is the problem: When I click on the new view controller, I use the following code:
NewViewController *newVC = [[NewViewController alloc] initWithNib:@"NewView" bundle:nil];
[self.navigationController pushViewController:newVC animated:YES];
[newVC release];
The code I use to return to the previous view inside the new VC:
[self.navigationController popViewControllerAnimated:YES]
I read that this could potentially release self.navigationController itself, so I implemented this code:
UINavigationController *nc = [self navigationController];
[nc popViewControllerAnimated:YES];
VC , , VC . ! viewWillAppear dealloc VC viewWillAppear + , dealloc newVC.
- , .
!
~