UIViewController *v1=[[UIViewController alloc] init];
v1.view.backgroundColor=[UIColor redColor];
UITabBarItem *v1BI=[[UITabBarItem alloc] initWithTabBarSystemItem: UITabBarSystemItemFavorites tag:101];
v1.tabBarItem=v1BI;
v1.tabBarItem.badgeValue=@"new";
v1.title=@"v1";
UINavigationController *v1NC=[[UINavigationController alloc] initWithRootViewController:v1];
UIViewController *v2=[[UIViewController alloc] init];
v2.view.backgroundColor=[UIColor greenColor];
UITabBarItem *v2BI=[[UITabBarItem alloc] initWithTitle:@"V2+" image:[UIImage imageNamed:@"201.png"] tag:102];
v2.tabBarItem=v2BI;
NSArray *conreollerArray=@[v1NC,v2];
//创建tabBarController
UITabBarController *rootBC=[[UITabBarController alloc] init];
rootBC.viewControllers=conreollerArray;
rootBC.tabBar.tintColor=[UIColor redColor];
rootBC.selectedIndex=1;
rootBC.delegate=self;
self.window.rootViewController=rootBC;