I wonder if someone can help me out with regards to the memory management in the code below. I am particularly interested in rootController, does it get retained when I do initWithRootViewController or does it instead (which is my guess) get retained with window addSubView: I am just curious what is happening ...
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
Base_TableViewController *rootController = [[Base_TableViewController alloc] init];
navController = [[UINavigationController alloc] initWithRootViewController:rootController];
[window addSubview:[navController view]];
[window makeKeyAndVisible];
[rootController release];
return YES;
}
- (void)dealloc {
[navController release];
[window release];
[super dealloc];
}
EDIT:
So essentially the code above is correct, the release at the bottom cancels out the alloc at the top, "rootController" is retained by navController?
Many thanks, much appreciated.
Gary