I have created a tabbar based project and my first tab have a navigation controller. and in my navigation controller (after push 2 views) i want to add/push one other tabbarcontroller. so please can any one suggest how i do this.
Asked
Active
Viewed 494 times
1 Answers
0
UPDATE: After reading your post once more I think I misunderstood it! UINavigationControllers can't have a UITabBarController inside them, it only works the other way round!
If you really want to do this (really think about it!!) you could write your own implementation of a UITabBarController that is happy inside of a UINavigationController (Twitter for iPhone uses such a custom written UITabBarController)
Link: UITabBarController insider UINavigationController
Just feed the tabbarcontrollers viewControllers property with an NSArray containing your UIViews. tabcontroller =[[UITabBarController alloc] init];
UINavigationController *navcon = [[UINavigationController alloc] init];
UINavigationController *navcon2 = [[UINavigationController alloc] init];
UINavigationController *navcon3 = [[UINavigationController alloc] init];
[navcon pushViewController:someuiview animated:NO];
[navcon2 pushViewController:someuiview2 animated:NO];
[navcon3 pushViewController:someuiview3 animated:NO];
[someuiview release];[someuiview2 release];[someuiview3 release];
tabcontroller.viewControllers=[NSArray arrayWithObjects:navcon, navcon2, navcon3, nil];
[navcon release]; [navcon2 release]; [navcon3 release];
someuiviewn are subclasses of UIViewControllers (maybe UITableViewControllers for example (or whatever :))