- (void)setupViewControllers
{
tabBarController = [[UITabBarController alloc] init];
HomeViewController *mainViewController = [[HomeViewController alloc] initWithNibName:@"HomeViewController" bundle:nil];
UINavigationController *firstNavController = [[[UINavigationController alloc] initWithRootViewController:mainViewController] autorelease];
mainViewController.shouldReloadCount = YES;
[mainViewController release];
MapViewController *currentLocationController = [[MapViewController alloc] initWithNibName:@"MapView" bundle:nil];
UINavigationController *secondNavController = [[[UINavigationController alloc] initWithRootViewController:currentLocationController] autorelease];
[currentLocationController release];
FavoritesViewController *favouriteController = [[FavoritesViewController alloc] initWithNibName:@"FavoritesViewController" bundle:nil];
UINavigationController *thirdNavController = [[[UINavigationController alloc] initWithRootViewController:favouriteController] autorelease];
[favouriteController release];
AllNotificationsViewController *notifController = [[AllNotificationsViewController alloc] initWithNibName:@"AllNotificationsViewController" bundle:nil];
UINavigationController *fourthNavController = [[[UINavigationController alloc] initWithRootViewController:notifController] autorelease];
[notifController release];
SettingsViewController *settingsController = [[SettingsViewController alloc] initWithNibName:@"SettingsViewController" bundle:nil];
UINavigationController *fifthNavController = [[[UINavigationController alloc] initWithRootViewController:settingsController] autorelease];
[settingsController release];
tabBarController.viewControllers = [NSArray arrayWithObjects:firstNavController, secondNavController, thirdNavController,fourthNavController,fifthNavController, nil];
firstNavController.tabBarItem.image = [UIImage imageNamed:@"house.png"];
firstNavController.tabBarItem.title = @"Home";
secondNavController.tabBarItem.image = [UIImage imageNamed:@"map.png"];
secondNavController.tabBarItem.title = @"Locator";
thirdNavController.tabBarItem.image = [UIImage imageNamed:@"fav.png"];
thirdNavController.tabBarItem.title = @"Favorites";
fourthNavController.tabBarItem.image = [UIImage imageNamed:@"profile.png"];
fourthNavController.tabBarItem.title = @"Activities";
fifthNavController.tabBarItem.image = [UIImage imageNamed:@"settings.png"];
fifthNavController.tabBarItem.title = @"Settings";
//[self.view addSubview:tabBarController.view];
[[[UIApplication sharedApplication].windows objectAtIndex:0] addSubview:tabBarController.view];
}