I know this has been answered before in different ways, but I am a novice programmer and really need some contextual help. I have a basic application that has multiple view controllers (.h, .m, .xib each. EX. about.h, about.m, about.xib, options.h, options.m, etc.). I need to switch between them on the press of a button.
I had been using:
xxxViewController *titleScreen = [[xxxViewController alloc] initWithNibName:@"xxxViewController" bundle:[NSBundle mainBundle]];
[self.view addSubview:titleScreen.view];
[xxxViewController release];
and it worked fine to switch the views. But then I noticed that in Instruments, the overall/net bytes kept climbing, without “releasing” the view that it came from.
Am I doing something wrong? Please help… I’m desperate!
You aren’t switching views, you’re just just adding one on top of the other that way. If you want to navigate between different views, chances are, you want a navigation controller.