tags:

views:

11

answers:

1

I'm adding navigation to subviews in my app from the home view. I understand the concepts of pushing and popping view in the navigation stack, however, I don't want the navigation bar in the home screen.

Basically, when the user leaves the home view to any sub view, I'd like them to see the "Home" button on the left of the button nav bar, but no nav bar in the home view.

Any help would be appreciated.

A: 

It sounds like you want to start out with a bare UIViewController, containing your home screen with your own custom buttons.

The UINavigationController should come into play only when a user performs some action. Do this by

[navVC setModalTransitionStyle:UIModalTransitionStyleCrossDissolve]; // pick an effect
[self.viewController presentModalViewController:VC animated:YES];

Where navVC is the navigation controller, and self.viewController refers to your (new) main view controller. (add a suitable line IBOutlet UIViewController *viewController; + @property line + @synthesize line)

You need to fiddle a bit in the way the app starts up, for now it will probably show the navigation controller directly. If you are using a xib, you can do this by adding a UIViewController while leaving the navigation controller there as it stands. In application: didFinishLaunchingWithOptions: you'll find a line saying

[window addSubview:...];

which actually determines which viewcontroller's view is first visible. Change this to:

[window addSubview:self.viewController.view];

If you've done all this correctly, you've inserted the extra UIViewController between startup and navigation.

mvds