views:

177

answers:

0

this is my code that i am using for this but i am getting the only the tab bar, no badgevalue on second item of tab bar

    tabBarController = [[UITabBarController alloc] init];
navigationController = [[UINavigationController alloc] init];
navigation1Controller = [[UINavigationController alloc] init];
navigation2Controller = [[UINavigationController alloc] init];
navigation3Controller = [[UINavigationController alloc] init];
navigation4Controller = [[UINavigationController alloc] init];
//navigation5Controller = [[UINavigationController alloc] init];

Recipe *photos = [[Recipe alloc] init];
shopping *videos = [[shopping alloc] init];
Interact *quiz = [[Interact alloc] init];
Video *aboutus = [[Video alloc] init];
about *feedback = [[about alloc] init];
int indexICareAbout = 2;
NSString *badgeValue = @"10";

[[[[[self tabBarController] tabBar] items] 
  objectAtIndex:indexICareAbout] setBadgeValue:badgeValue];  


     [navigationController pushViewController:photos animated:NO]; 
     [navigation1Controller pushViewController:videos animated:NO]; 
     [navigation2Controller pushViewController:quiz animated:NO]; 
     [navigation3Controller pushViewController:aboutus animated:NO]; 
     [navigation4Controller pushViewController:feedback animated:NO]; 


  tabBarController.viewControllers = [NSArray   arrayWithObjects:navigationController,navigation1Controller,navigation2Controller,navigatio  n3Controller,navigation4Controller,nil];  

 tabBarController.moreNavigationController.navigationBar.barStyle =       UIBarStyleBlackOpaque;

tabBarController.customizableViewControllers = nil;
[self.view addSubview:tabBarController.view];