UITabBarController

AppDelegate.h
@property(nonatomic,retain) UITabBarController *TabBarController; AppDelegate.m
#import “firstViewController.h”
#import “secondViewController.h” self.TabBarController=[[UITabBarController alloc]init];

firstViewController *first=[[firstViewController alloc]init];

first.title=@”honda civic”; //or below

first.tabBarItem.image=[UIImage imageNamed:@”honda-civic-in-india- 139542.png”];

secondViewController *second=[[secondViewController alloc]init];

second.title=@”i phone”; //or below

second.tabBarItem.image=[UIImage imageNamed:@”iphone-5-review- 1.png”];

self.TabBarController.viewControllers=[[NSArray alloc]initWithObjects:first,second, nil];

[[self. TabBarController.tabBar.items objectAtIndex:0] setTitle:@” honda civic “];

[[self. TabBarController.tabBar.items objectAtIndex:1]setTitle:@” i phone “];

[self.window setRootViewController:self.TabBarController];

Leave a comment