IPhone Obj C - 2nd XIB How to configure a Nav Controller and View Controller?

The XIBs or the UIViews (or it's subclasses) are just the facial make up.

The XIBs or the UIViews (or it's subclasses) are just the facial make up. For the actually programming part, you deal directly among the "controllers" classes for these views. View controllers that you make can have an XIB attached to them.

But the behavior of how and when the view is shown or hidden, is all handled by the view controller itself. So to come to the point, if you want to have a navigation bar on the top of you app (assuming that it's a simple app wanting to show many views with a navigation bar): Create a UINavigationController instance in your applicationDidFinishLaunching: method in the app delegate: // Assuming that mainViewController is the first controller + view for your app. NavigationController = UINavigationController alloc initWithRootViewController:mainViewController; window addSubview:navigationController.

View; This will automatically add a navigation bar to your views. You don't need to add them manually in XIB or anywhere else. Now how you draw/implement mainViewController, is up to you.

When you want to show another view from within mainViewController, you should call: AnotherViewController *anotherViewController = AnotherViewController alloc init autorelease; self. NavigationController pushViewController:anotherViewController animated:YES; This will "push" your new view (from anotherViewController instance) into your navigation structure, which will automatically add a back button on the top. Hope this helps clear the scene of how it works, a bit.

If you have doubts, comment about it. Have a great day!

What is the class in the . H file for the sub menus? – Mark Worsnop May 11 at 2:48 By sub menus, you mean the table of options that you can tap and it opens new views?

That can be done by implementing a UITableView. And detect when a particular cell is tapped/selected, init the corresponding view controller and do another pushViewController. No, you don't need to create multiple UINavigationControllers.

Just one is enough to handle a particular hierarchy. – Gurpartap Singh May 13 at 18:22 Accept the answer if it resolved your question. :) – Gurpartap Singh Jul 7 at 22:41.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions