Search code examples
iphonesdkobjective-c-2.0

How to add a 2nd view as a Tab Bar View (iPhone SDK)


So before I've managed to work with TabBarViewControllers and create an application using them. However every time I do so the view acts as my main view. This time around I want my TabBarView to be my second view in my application

E.g

First window has a bunch of buttons, when I click one of these buttons I want the second view to show up. This view includes a TabBarViewController.

The farthest I've gotten is to have the button show a view but for some reason it won't show my TabBar view!

Here's the code for my button

- (IBAction)showEvents:(id)sender {

EventsViewController *controller = [[EventsViewController alloc] initWithNibName:@"EventsView" bundle:nil];
controller.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:controller animated:YES];

}

Any of you guys able to help?


Solution

  • Anyway, I found a solution and it was actually quite simple. After creating the Outlet for the TabBarController and linking it together with File's Owner all I had to do was add

    self.view = tabViewController.view;

    On the viewDidLoad method