views:

292

answers:

1

Hello -

I have my views that are part of a tabBar. Each view has a navigationController. In one of my views I have an embeded xib component. This is a scrolling view with UIButtons inside it.

I want to slide in another view, inside the navigationController when a person taps the button. I can get the taps, etc.

BUT, I can't figure out how to find the controlling navigationController of that page to push the new view into. Nothing seems to work that I have tried.

IS this possible?

Thanks

A: 

You need to pass a reference to the navigation controller "down" your view hierarchy. Or pass another object that has a reference to the navigation controller "down". Or get the app delegate if it has a reference to the navigation controller.

gerry3
I have seemingly done all those things.. and no matter what.. nothing happens.. though it is calling my other view controller and the button does go darker.
Do you know that the navigation controller is set up correctly--can you push a view right away after it's setup from the app delegate? Do you know that the reference had been properly passed down--did you use NSLog to display the pointer and make sure it is non-nil and matches what was created/setup?
gerry3
Ok.. I am very confused.I have a view HomeView where this "pushes" correctly:- (void)openPopularArtists:(id)sender { GalleryViewController *controller = [[GalleryViewController alloc] initWithNibName:@"GalleryViewController" bundle:nil]; [[self navigationController] pushViewController:controller animated:YES]; [controller release];}However, if I log out in the initWithNib :NSLog (@"1Nav is %@",[self navigationController]); I GET NULL ??!!I have a tabbar with controllers of navigationControllers each one with their own rootViewController.help
Where is this NSLog statement? In GalleryViewController.m? Can you post the code with details as an update to your original question?
gerry3