views:

93

answers:

1

I have one issue with UInavigationcontroller

In my firstview i have button.If i click that button it should open tableview in secondview .If i click tableviewcell is connect to third view.it is second and thirdview used to the navigationbar

Please help in this issue.

A: 

in appDelegate create a navigationcontroller like this i am posting sample code

HomeScreen *homeScreenObject=[[HomeScreen alloc] initWithNibName:@"HomeScreen" bundle:nil];
self.navController =[[UINavigationController alloc] initWithRootViewController:homeScreenObject];
[homeScreenObject release];
[window addSubview:[navController view]];
// Override point for customization after application launch
[window makeKeyAndVisible];

navController is instance Variable declared in header file UINavigationController *navController;

now on your firstviewcontroller create a IBAction and bound your button's touch down event with that action and use these lines in that method

 ViewController *ViewControllerObject = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];
 [self.navigationController pushViewController:ViewControllerObject animated:YES];
 [ViewControllerObject release];

so the viewController should have a tableView and on tableView's delegate method "didSelectRowAtIndexPath" use the above code for further navigation

Rahul Vyas