I am very new to the iPad UISplitViewController
.
I need
you have to take UITabBarController dynaically.
In .h file
UITabBarController *tabBar;
in .m file
create objects to your classes in appDidFinish Launch
For example you have
Class1 and Class2
in appDidFinishLaunch
Class1 *obj1=[Class1 alloc]initWithNibName:@"Class1" bundle:nil]; **Class2 obj2=[Class2 alloc]initWithNibName:@"Class2" bundle:nil];*
// Master navigation controller by defaults comes with template code
// Now you have create Array for tabBar
NSArray *tabViewArray=[[NSArray alloc] initWithObjects:obj1,obj2,masterNavigationController, nil];
tabBar=[[UITabBarController alloc] init];
[tabBar setViewControllers:tabViewArray];
// now you have to edit the statement which contains splitview.viewArray repalce masterNavigataionControler with tabBar
self.splitViewController.viewControllers = [NSArray arrayWithObjects:tabBar, detailNavigationController, nil];
Try this i hope it will helps you.
in your app delegate add tabbar controller then add your view controllers to tabbar controller and set the window rootview controller to tabbar controller.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
self.tabbar=[[UITabBarController alloc] init];
self.vc1 = [[vc1 alloc] initWithNibName:@"ViewController_iPhone" bundle:nil];
// do the same to other VCs
self.tabbar.viewControllers=[NSArray arrayWithObjects:vc1,vc2,vc3,vc4, nil];
self.window.rootViewController = self.tabbar;
[self.window makeKeyAndVisible];
return YES;
}
i hope it helps :-)
All you have to do is initialize the first argument of uispliviewcontroller for view as tabbar instead of a view or you can use uisegmentedcontrol.