Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

tutiplain

macrumors member
Original poster
Feb 4, 2011
95
0
Hi all, I have a project I am trying to configure to use a UINavigationController. I have set up my NIB files as suggested in the Apple developer Docs (in the main window nib). I have also sucessfully managed to display my root view controller (that is, the view controller sitting at the top of the navigation stack. However, I cannot seem to display other levels of information. The reason is that my UINavigationController instance is defined in my App Delegate object, but the root view controller is defined in another class, a custom class inheriting from UIViewController. I don't understand how to display different levels of data unless the navigation interface is defined in the root view controller itself. I know I'm not proving an example of what I'm doing, but hopefully someone can point me in the right direction?

Many thanks for any info.
 

dantastic

macrumors 6502a
Jan 21, 2011
572
678
In your navigation controller window, stick in a button to call this:
Code:
SecondLevelController *nextController = [[SecondLevelController alloc] init];
[self.navigationController pushViewController:nextController animated:YES];
[nextController release];

This is all relative to the navigation controller so it doesn't matter where it is defined.
 

jnoxx

macrumors 65816
Dec 29, 2010
1,343
0
Aartselaar // Antwerp // Belgium
You have to understand the concept of OO programming.
To use that "SecondController" as the guy defined above me, (could be any class (tableview/uiviewController subclasses etc), u have to import this at the top, so u can use it to push it onto the navigation stack :)
Don't forget to give ur first screen a title, otherwise the back button won't display on the second screen.
IF any more questions, go ahead :)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.