title: How to load a different view controller when changing the tab bar in the master view controller?
body: <p>I am creating an iPad as in the <a href="https://stackoverflow.com/questions/9309879/how-to-update-a-uitableview-in-detailview-when-changes-the-tabbar-in-the-pop-ove">link</a>. In this one I need to load different viewcontrollers when I change the tab in the masterside. How can I implement this? I have created the tabbar controller as follows: in the Appdelegate.m file</p>
  
  <pre><code>- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
  {
      self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
      // Override point for customization after application launch.
  
      tabBarController = [[UITabBarController alloc] init];
  
      StudentVC *stdntVC = [[[StudentVC alloc]initWithNibName:@"StudentVC" bundle:nil] autorelease];
      TeachersVC *teachersVC = [[[TeachersVC alloc]initWithNibName:@"TeachersVC" bundle:nil] autorelease];
      MasterViewController *masterViewController = [[[MasterViewController alloc] initWithNibName:@"MasterViewController" bundle:nil] autorelease];
      ConfigurationVC *configViewController = [[[ConfigurationVC alloc] initWithNibName:@"ConfigurationVC" bundle:nil] autorelease];
  
      UINavigationController *masterNavigationController = [[[UINavigationController alloc] initWithRootViewController:masterViewController] autorelease];
      UINavigationController *studentNavigationController = [[[UINavigationController alloc] initWithRootViewController:stdntVC] autorelease];
      UINavigationController *teacherNavigationController = [[[UINavigationController alloc] initWithRootViewController:teachersVC] autorelease];
      UINavigationController *configNavigationController = [[[UINavigationController alloc] initWithRootViewController:configViewController] autorelease];
  
      NSArray* controllers = [NSArray arrayWithObjects:studentNavigationController,teacherNavigationController,masterNavigationController, configNavigationController, nil];
      tabBarController.viewControllers = controllers;
  
      ShowDetailsVC *showViewController = [[[ShowDetailsVC alloc] initWithNibName:@"ShowDetailsVC" bundle:nil] autorelease];
      UINavigationController *detailNavigationController = [[[UINavigationController alloc] initWithRootViewController:showViewController] autorelease];
  
  
      self.splitViewController = [[[UISplitViewController alloc] init] autorelease];
      self.splitViewController.viewControllers = [NSArray arrayWithObjects:tabBarController, detailNavigationController, nil];
  
      self.splitViewController.delegate = showViewController;
  
      self.window.rootViewController = self.splitViewController;    
  
      stdntVC.detailsVC = showViewController;
      teachersVC.detailsVC = showViewController;
      masterViewController.detailsVC = showViewController;
      configViewController.detailsVC = showViewController;
  
      [self.window makeKeyAndVisible];
  
      return YES;
  }
  </code></pre>
  
  <p>Here is the screen shot: <img src="https://i.stack.imgur.com/Ujq96.png" alt="enter image description here">
  Please share your ideas.</p>