Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

99miles

macrumors member
Original poster
Oct 10, 2008
50
0
I have a main view showing with a button that will open a navigation controller:

Code:
pView = [[PreferencesViewController alloc] init];
navigationController = [[UINavigationController alloc] initWithRootViewController:pView];
[pView release];
[ window addSubview:[navigationController view] ];

Then you can navigate within the navigation controller to other views which are pushed on like:

Code:
    [[self navigationController] pushViewController:subViewController animated:YES];

But when you back up out of the navigation it will remove all those views:

Code:
[[navigationController view] removeFromSuperview];
[navigationController release];
navigationController = nil;

But only the dealloc of the rootViewController is getting called. How would I go about removing all the other views that were opened in the navigation?
I would have thought that by clearing out the navigationContoller that would take care of it, but apparently not.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.