//here is the code that i implement successfully.......
//in .h set delegate UITabBarControllerDelegate,UITabBarDelegate
UINavigationController *navigationController;
UITabBarController *tabBarController;
@property(strong,nonatomic) UINavigationController *navigationController;
@property(strong,nonatomic) UITabBarController *tabBarController;
//in .m
tabBarController = [[UITabBarController alloc] init];
[tabBarController setDelegate: self];
//for tabbar background
tabBarController.tabBar.tintColor=[UIColor colorWithPatternImage:[UIImage imageNamed:@"tabbg.png"]];
NSMutableArray *localViewControllersArray = [[NSMutableArray alloc] initWithCapacity:4];
Demo1 *home = [[Login alloc] initWithNibName:@"Login" bundle:nil];
localNavController = [[UINavigationController alloc] initWithRootViewController:home];
localNavController.tabBarItem.title=@"demo1";
[localViewControllersArray addObject:localNavController];
Demo2 *puck=[[Demo2 alloc]initWithNibName:@"Demo2" bundle:nil];
localNavController = [[UINavigationController alloc] initWithRootViewController:puck];
localNavController.tabBarItem.title=@"demo2";
[localViewControllersArray addObject:localNavController];
Demo3 *photo=[[Demo3 alloc]initWithNibName:@"Demo3" bundle:nil];
localNavController = [[UINavigationController alloc] initWithRootViewController:photo];
localNavController.tabBarItem.title=@"demo3";
[localViewControllersArray addObject:localNavController];
Demo4 *more=[[Demo4 alloc]initWithNibName:@"Demo4" bundle:nil];
localNavController = [[UINavigationController alloc] initWithRootViewController:more];
localNavController.tabBarItem.title=@"demo4";
[localViewControllersArray addObject:localNavController];
[[UITabBarItem appearance] setTitleTextAttributes:
[NSDictionary dictionaryWithObjectsAndKeys:
[UIColor grayColor], UITextAttributeTextColor,
[UIColor grayColor], UITextAttributeTextShadowColor,
[NSValue valueWithUIOffset:UIOffsetMake(0, 1)], UITextAttributeTextShadowOffset,
[UIFont fontWithName:@"Helvetica" size:0.0], UITextAttributeFont,
nil]
forState:UIControlStateNormal];
//tab bar selected and unselected icons
UITabBarItem *tabBarItem1 = [[self.tabBarController.tabBar items] objectAtIndex:0];
[tabBarItem1 setFinishedSelectedImage:[UIImage imageNamed:@"puckCentralA.png"] withFinishedUnselectedImage:[UIImage imageNamed:@"puckCentral.png"]];
UITabBarItem *tabBarItem2 = [[self.tabBarController.tabBar items] objectAtIndex:1];
[tabBarItem2 setFinishedSelectedImage:[UIImage imageNamed:@"puckDisplayA.png"] withFinishedUnselectedImage:[UIImage imageNamed:@"puckDisplay.png"]];
UITabBarItem *tabBarItem3 = [[self.tabBarController.tabBar items] objectAtIndex:2];
[tabBarItem3 setFinishedSelectedImage:[UIImage imageNamed:@"photoBoothA.png"] withFinishedUnselectedImage:[UIImage imageNamed:@"photoBooth.png"]];
UITabBarItem *tabBarItem4 = [[self.tabBarController.tabBar items] objectAtIndex:3];
[tabBarItem4 setFinishedSelectedImage:[UIImage imageNamed:@"moreA.png"] withFinishedUnselectedImage:[UIImage imageNamed:@"more.png"]];
[self.window addSubview:tabBarController.view];