0

I have a UISplitViewController which I have set as rootViewController in appDelegate.But before displaying UISplitViewController,there are two UIViewControllers. When the app starts,there will be UIViewController one after another.Then from second UIViewController,it will navigate to UISplitViewController. Now,it is simple to display UISplitViewController from UIViewControllers, but problem arises when i want to display UIViewController from UISplitViewController. Means,unable to navigate between UIViewControllers and UISplitViewController. I have checked every solution.I also tried to presentViewController but it just failed. Please help me. It would be great pleasure to get solution from here.

Sushil Sharma
  • 2,321
  • 3
  • 29
  • 49

2 Answers2

0

check this link.According to your question i too tried like this before after that i googled and i got this solution.

How to create a segue from UIViewController to a UISplitViewController

Community
  • 1
  • 1
Ganesh Kumar
  • 708
  • 6
  • 25
  • Thanks for your reply @user3698223. I have tried this code.I am adding `UISplitViewController` same like this.But the problem is that I can't Pop back from `UISplitViewController` to `UIViewController`. As you said ,you were having same problem then how did you pop to `UIViewController` from `UISplitViewController`?. – Sushil Sharma Aug 08 '14 at 11:27
0

I was facing the same issue.I resolved this problem by putting whole project in UISplitViewController and then hiding/Unhiding the masterViewController. Here is the code to hide the MasterViewController. Firstly using UISplitViewController's Delegate method

- (BOOL)splitViewController:(UISplitViewController *)svc shouldHideViewController:(UIViewController *)vc inOrientation:(UIInterfaceOrientation)orientation
{
      return YES;
}

then declare this BOOL masterIsHidden; under implementation then add the following method

-(void)hideMaster:(BOOL)hideState
{
    masterIsHidden=hideState;
    [self.splitViewController.view setNeedsLayout];
    self.splitViewController.delegate = nil;
    self.splitViewController.delegate = self;
    [self.splitViewController willRotateToInterfaceOrientation:[UIApplication sharedApplication].statusBarOrientation duration:0];
}

and call this above method in viewWillAppear like this

[self hideMaster:YES];

Using this method you can hide/Unhide masterViewController anywhere in your project.

Sushil Sharma
  • 2,321
  • 3
  • 29
  • 49
Sushil Sharma
  • 945
  • 1
  • 7
  • 9