0
votes

im new to iphone coding and i would like some help with a tab-bar project as i found on www.fuelyourcoding.com

He is creating a custom tabbar. He can then change color of the tab-bar instead of the standard grey color.

How can i Add a third tab? I have tried to create a "ThirdViewController" as the project contained a first and a second-viewcontroller. I've also tried to copy all the information i thought could affect the tabs, and inserted "ThirdViewController", where it previously said "SecondViewController" and so on.

It's hard to describe, but here is the link if someone would be kind to have a look at it.

http://fuelyourcoding.com/files/files.zip

Thanks!

1
There is a place where it says self.tabBarController.viewControllers = @[viewController1, viewController2];. How have you changed that line?Ravi

1 Answers

0
votes

In general, you create a tab bar controller and three view controllers. You add these three view controllers to the tab bar controller and add the tab bar controller as the root view controller of the app delegate. There's not a lot that can go wrong with this idea, but if you can show more code, that will be great.

Here's the example:

    ViewController1 *v1 = [[ViewController1 alloc] init];
    ViewController2 *v2 = [[ViewController2 alloc] init];
    ViewController3 *v3 = [[ViewController3 alloc] init];

    self.tabBarController.viewControllers = @[v1, v2, v3];
    self.window.rootViewController = self.tabBarController;