UITabBarController* tabbar = [[UITabBarController alloc] init];
tabbar.delegate = self;
FirstViewController* first = [[FirstViewController alloc] init];
SecondViewController* second = [[SecondViewController alloc] init];
NSArray* array = [NSArray arrayWithObjects:first,second, nil];
tabbar.viewControllers = array;
[first.tabBarItem initWithTitle:@"first" image:[UIImage imageNamed:@"alarm_30.png"] tag:1];
[second.tabBarItem initWithTitle:@"second" image:[UIImage imageNamed:@"alien_30.png"] tag:2];
first.tabBarItem.badgeValue = @"1";
[self.view addSubview:tabbar.view];