Search code examples
iosobjective-ciphoneipaduisplitviewcontroller

How to make the UISplit view controller works similar to iPhone for iPad destination?Is there any issue with segues?


In My app,I used split view controller, it works fine in iPhone,but not in iPad destination.It may be functionality or UI bug .I couldn't find out.I post the screen shots below for reference.

I tried out this in demo project same issue occurs.

1.This Image shows the iPhone destination's(simulator mode) "view controller" of the split view controller.

enter image description here

2.This Image shows the iPhone's "Root view controller", when I click back button in "view controller" it goes to "Root view controller".

enter image description here

3.Again If I click the apply button,it shows the "view controller".This Image shows this. enter image description here

Up to this It works fine in iPhone.

4.This image shows the iPad "view controller" of the split view controller.

enter image description here

5.when I scroll the view controller horizontally it shows the "root view controller".

enter image description here

Up to this it works fine in iPad.

6.If I click the apply button of the "Root view controller" it shows "view controller" in "master view" not in "detail view".This screen shot shows this.

enter image description here

I solved the above issue using below story board and code.

7.This is my story board image.I had tried like this.But it having some issues.

enter image description here.

For this story board I put this code:

- (IBAction)btnApply:(id)sender 
{
ViewController *controller = [self.storyboard instantiateViewControllerWithIdentifier:@"wktimefilter"];
[self.navigationController presentViewController:controller animated:NO completion:Nil];
}

This is my next issue:

https://stackoverflow.com/questions/35795396/split-view-controller-issue-with-iphone-and-ipad-tab-bar-disappears-moving-from

For this my Story board like this:

1.splitview controller ---> navigation controller ---> Root view controller ---> view controller

2.Again view controller connected with split view controller.

My Piece of code for onclick the apply button:

// when I click apply button in "Root view controller" moves to "view controller" 

- (IBAction)btnApply:(id)sender 
{
[self performSegueWithIdentifier:@"view controller" sender:sender];
}

In storyboard segue between "root view controller" and "view controller".

In attributes inspector

segue:push destination:current

Destination having some other options it is given by:

1.master split. 2.detail split.

If I changed segue to : "Replace" destination:"detail split".It throws error.

Now I tried to embed navigation controller for view controller.then connect a segue between "Root view controller" and "navigation controller".But it doesn't works.How to solve this?

How to fix this issue in iPad?Through UI or code. Is there any possibilities to avoid this.Any suggestions,Thanks in Advance.

Sorry For confusing one question with other,Right now the issue is the next question:

https://stackoverflow.com/questions/35795396/split-view-controller-issue-with-iphone-and-ipad-tab-bar-disappears-moving-from


Solution

  • Use Show Detail segue. If you're already doing that, there may be something wrong with your master detail setup. Is this how your storyboard is configured? enter image description here