I’m not sure how this works. For nav ctlrs, do I just alloc/init/ autorelease the view controller I want and then push it onto the stack? It seems to work, I just didn’t know if there was more to it since I’ve seen other code where ppl set an NSArray of view controllers for the nav ctlr and I didn’t know if I needed to do that or what that approach brought me instead. Thanks!
Share
You can just alloc/init/autorelease and push. That works fine.
If you want to set up your navigation controller with a stack of view controllers, so the user can immediately use the back button, you use
-[UINavigationController setViewControllers:]. For example, when the application is launched, you might load the user’s previous state from a file or preference and use that to set the stack of view controllers.