I'm programmatically creating a tab bar based app. In the application:didFinishLaunchingWithOptions (app delegate) method I've put:
self.tabBarController = [[[UITabBarController alloc] init] autorelease];
SearchViewController *search_vc = [[[SearchViewController alloc] init] autorelease];
SearchBookmarksViewController *search_bookmarks_vc = [[[SearchBookmarksViewController alloc] init] autorelease];
ItemsBookmarksViewController *items_bookmarks_vc = [[[ItemsBookmarksViewController alloc] init] autorelease];
AboutUsViewController *aboutus_vc = [[[AboutUsViewController alloc] init] autorelease];
UINavigationController *search_nav = [[[UINavigationController alloc] initWithRootViewController:search_vc] autorelease];
UINavigationController *search_bookmarks_nav = [[[UINavigationController alloc] initWithRootViewController:search_bookmarks_vc] autorelease];
UINavigationController *items_bookmarks_nav = [[[UINavigationController alloc] initWithRootViewController:items_bookmarks_vc] autorelease];
UINavigationController *aboutus_nav = [[[UINavigationController alloc] initWithRootViewController:aboutus_vc] autorelease];
NSArray vc_stack = [NSArray arrayWithObjects:search_nav,search_bookmarks_nav,items_bookmarks_nav,aboutus_vc,nil];
tabBarController.viewControllers = vc_stack;
[self.window addSubview:tabBarController.view];
SearchViewController is basically a search form showing results in a UItableView with rows which when selected show details about the chosen row. User can also press a "View Photos" button that push a view controller with a UIImageView to show some photos.
Now when working on the photo view I had to handle landscape orientation which seems not working easily in tab bar applications. Can you help about what to do exactly to allow this photo view controllers to handle landscape orientation ?
I've been told to make shouldAutorotateToInterfaceOrientation method to return YES in every view controller thus making any view to allow landscape orientation OR to subclass TabBarController and this last solution could cause my app to be rejected by Apple. So I'm a bit confuse about what to do exactly...
Thx in advance for your help!
Stephane