views:

11

answers:

0

Hi I have to create the following View Hierarchy in my app:

RootViewController will be a simple View Controller with some buttons you can click that gets you to the FirstViewController:

This code will insert the RootViewController with the buttons onscreen:

appDelegate:

UIViewController *rootViewController = [[RootViewController alloc] init];

[window addSubview:rootViewController.view];

FirstViewController will contain a TabBarController with two tabs:

Tab 1: will contain a Navigation Controller that push: SecondViewController -> DetailViweController

Tab 2: will contain a Navigation Controller that push: ExtraViewController -> DetailViewController

my questions is:

What code do I need to insert the TabBarController with the above hierarcy when I click a button?

RootViewController.m:

-(IBAction)buttonClicked:(id)sender {

}