Consider this code to push a new controller onto the nav stack:
AlphaColorController * a = [[AlphaColorController alloc] initWithColor:color name:name alpha:0.25];
[[self navigationController] pushViewController:a animated:YES];
[a release];
There is no pointer kept for a. If a user navigates into this new controller, then navigates “back”, and then “forward” again, is the nav controller smart enough to know this controller is already there, or if it isn’t, to allocate it again? How necessary is it to first test (using a pointer) if the controller has been instantiated yet before pushing it multiple times?
UPDATE: putting it another way, will this code effectively re-allocate the controller every single time the user navigates into that particular area of the nav controller? the nav controller is going to rereate and push the newly created controller every time?
I don’t think you understand how your code is operating. You are, in fact, creating the new view controller object you speak of, and you are, in fact, pushing it onto the nav stack. And what do you mean not keeping a pointer to it? That little star ain’t there for nothin’!
NavigationControllers keep a reference to their navigation stacks until such a time as a view is popped off the stack. In which case, said view is deallocated and destroyed.