views:

162

answers:

1

I'm trying to figure out how to link all the views I've made in interface builder with a navigation controller but I'm finding the concept a little tricky to grasp.

All the example code I have looked at shows how to do this with arrays that store all your controllers and i'm finding it difficult to adapt to my project as my views have been completely built in IB and not in xCode.

thanks in advance.

+1  A: 

Generally speaking a navigation controller maintains a stack of viewControllers that you push and pop onto. If you are using IB when you drag a Navigation Controller from the library into you application window it will actually add a number of objects including a UIViewController that will act as the Root View Controller. Change the class of that root view controller to be the class of your first view controller.

You can create additional view controllers (I would put these other view controllers in separate NIB files) which you then push onto the view controller stack when you want to make them visible. You don't need to link them to the navigation controller in IB.

kharrison
Thanks for your time and help :)
Dave