I create a custom view controller named HomeViewController which inherits from UIViewController. In main application delegate, I show it by calling [window addSubview:homeViewController.view] inside function applicationDidFinishLaunching. Yeah, everything works fine.
Now I add a button into the HomeViewController xib file. When I click on it, I want the window to remove the current view and add another navigationController instead. I make a function inside HomeViewController.m and link to the button but I don't know how to access the property window from there. window is a local variable inside the main app delegate and button click handler is inside HomeViewController. I'm thinking of doing the similar thing as above which is to add navigationController.view as subview of window.
Sorry! I'm very new to this iphone app development. I don't really get the big picture of how the application flow should be. Perhaps something's wrong with the structure of my project?