I am working on tab bar application in which i called navigation controller on following way The problem is i cannot able to oriented to Landscape mode. can anybody please say what i went wrong?
Regards, sathish
-(IBAction)click
{
tabBarController = [[UITabBarController alloc] init];
NSMutableArray *localControllersArray = [[NSMutableArray alloc] initWithCapacity:5];
UINavigationController *localNavigationContriller;
FavouritesViewController *master;
master = [[FavouritesViewController alloc] initWithTabBar];
localNavigationContriller=[[UINavigationController alloc] initWithRootViewController:master];
[localNavigationContriller.navigationBar setBarStyle:UIBarStyleBlackTranslucent];
[localControllersArray addObject:localNavigationContriller];
//[localNavigationContriller release];
[master release];
NeedViewController *need;
need = [[NeedViewController alloc] initWithTabBar];
localNavigationContriller=[[UINavigationController alloc] initWithRootViewController:need];
[localNavigationContriller.navigationBar setBarStyle:UIBarStyleBlackTranslucent];
[localControllersArray addObject:localNavigationContriller];
//[localNavigationContriller release];
[need release];
DontNeedViewController *dontneed;
dontneed = [[DontNeedViewController alloc] initWithTabBar];
localNavigationContriller=[[UINavigationController alloc] initWithRootViewController:dontneed];
[localNavigationContriller.navigationBar setBarStyle:UIBarStyleBlackTranslucent];
[localControllersArray addObject:localNavigationContriller];
//[localNavigationContriller release];
[dontneed release];
tabBarController.delegate=self;
tabBarController.viewControllers = localControllersArray;
[localControllersArray release];
[[[UIApplication sharedApplication] keyWindow] addSubview:tabBarController.view];
}