Search code examples
iphoneiosipaduitabbarcontrolleruisplitviewcontroller

How to set the split view control within a UITabbarController


few days to start the iPad development and i face the some problem,

In that the i create the one viewcontroller in which shows the numbers of the options like Deskboard then after open the splitview controller

Flow like following

View Controller
   |
   |->Splite view controller(with Tabbar controll)
                |
                |->Left controller(UITableview)
                |
                |->Right Controller(navigation controller)

Thus i expected output like below

enter image description here

so anyone can guide for solving the problem.

guys any ideas or work arounds?

Please let me know if I am not clear in my question.

Thanks and Regards,

Samuel.


Solution

  • I solve this problem by Cocoa Matter solution thanks for it

    And now form above solution i enhance the solution and now the problem solved.

    following is the code for the solution .h file

    @property(nonatomic,retain)UISplitViewController *splitController;
    

    .m file

       UIViewController *viewController5 = [[searchDetail alloc] initWithNibName:@"searchDetail" bundle:nil];
        delegate.tabBarController.viewControllers = [NSArray arrayWithObjects:viewController1, viewController2, navForLogin, navForContact, viewController5, nil]; 
    
        SearchVctr *viewController1 = [[SearchVctr alloc] initWithNibName:@"SearchVctr" bundle:nil];
        FavouriteVctr *viewController2 = [[FavouriteVctr alloc] initWithNibName:@"FavouriteVctr" bundle:nil];
        self.splitController = [[UISplitViewController alloc] init];
        [self.splitController setViewControllers:[NSArray arrayWithObjects:viewController1, viewController2, nil]];
        self.splitController.delegate = self;
        viewController5.view=self.splitController.view;
    
        delegate.tabBarController.selectedIndex = 4;
        delegate.imgV.image=[UIImage imageNamed:[NSString stringWithFormat:@"t4_ipad.png"]];
        delegate.tabBarController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
        delegate.self.imgV.frame=CGRectMake(0, 0, 1024, 48);
        [self presentModalViewController:delegate.tabBarController animated:YES];
    

    Thanks for the Reply,