tags:

views:

72

answers:

0

I have 2 UITableViewController on UITabBarController without navigation bar. That's how i created it:

UITabBarController *tabBarController = [ [UITabBarController alloc] init ]; 
tabBarController.viewControllers = [ NSArray arrayWithObjects:  
 [ [ [MyUITableViewController alloc] init ] autorelease ],
 [ [ [MyUITableViewController alloc] init ] autorelease ], nil];


[window addSubview: tabBarController.view];

On

 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath

I need open UIViewController with navigation bar and back button. I would like that UIViewController appearance will be animated. After i press back button on UIViewController it's should return back to my UITableViewController without navigation bar.

On didSelectRowAtIndexPath i try:

MyUIViewController *mController = [ [MyUIViewController alloc] init ];

UINavigationController *addNavigationController = [ [UINavigationController alloc] initWithRootViewController: mController ];

[self.setNavigationController: addNavigationController];

[self.navigationController pushViewController: addNavigationController animated:YES];

[addNavigationController release];

unfortunately it doesn't work. How can i solved my problem?