Dynamically Change Detail View Controller - ios

I have a Split View controller set up in Storyboard, and I need to be able to change the Detail View Controller dynamically. By default, the Detail View Controller has a "relationship" segue to a Navigation Controller, which leads to the original Detail View Controller. How can I dynamically change this relationship to another controller?

You can do this a couple different ways. If you want to do it all in storyboard, you can create a segue from your master view controller buttons or cells to your detail view Controller and choose the "replace" segue option. You can also do this in code where your master view controller stores a reference to the detail view controller (UINavigationController) and replace out the root view controller.

Related

UISplitViewController - Tapping on cell in master view controller causes segue in master view controller and not in detail view controller

I'm working to migrate an existing project with a standard table view to use the UISplitViewController methodology. The standard table view is also linked to a Tab Bar Controller.
The hierarchy is as follows:
Tab Bar Controller > SplitViewController > MASTER: NAVIGATION CONTROLLER > TABLE VIEW;
SplitViewController > DETAIL: Navigation Controller > TABLE VIEW;
When I tap on a cell in the master view controller, it causes a segue of the view I want loaded in the detail view area to be in the master view controller table view area. In essence, the detail view controller loads in the master view window area.
I've validated that all connections are made correctly, but I don't know why this is happening. Any insight would be appreciated!
Not sure if you ever got to the bottom of this or not but I just ran into the same issue and thought I'd explain how I fixed it incase anyone-else comes across it.
Basically make sure that the detail view controller is linked in your Split View Controller in the storyboard before linking the cells selection segue to the detail view controller.
Recreating the segue between the cell and the detail view controller was enough to fix this for me after I'd set the split view controller correctly.
Hope that helps,
Richard

parentViewController and presentingViewController both are nil

I have a tabBarController with 5 tabs the third tab is a navigation controller with TableViewController as the root view controller.
When I press on a row on the table view it push a detail view (regular view controller) about the selected row.
The problem is first time parentViewController and presentingViewcontroller properties (in the details page) are set, all other consecutive both properties are set to nil.
EDIT
I created a single tab application with navigation controller same as the one in the picture but I did not disable auto layout in the storyboard, every time parentViewController is set correctly.
I believe this is a bug if you disabled auto layout.
You are neither creating a child view controller, nor presenting a modal.
(Pushing a detail view controller onto a navigation controller's stack is kind of like adding a child, but navigation controllers predate the parent/child view controller mechanism, so they don't use it.)
What you need to check is the navigationController property of your detail view controller. That should be non-nil if it was pushed onto a navigation controller stack.

Relationship among split view controller, tab bar controller, and multiple tableview controllers

In my universal app with a split view controller at the top of the hierarchy, I want a tab bar controller with multiple table view controllers as the tabs. What should the storyboard and relationships look like?
I started with the default empty universal master/detail project. I got the standard split view controller with two navigation controllers pointing to the master table view controller and detail view controller. If I embed that master table view controller in a tab bar controller, that table view controller's detail view (actually, the detail view's navigation controller) remains the split view controller's detail view. When I add another table view controller and make it a tab of the tab bar controller, how to I hook that table view and its detail view to the split view controller? Whew.
Thanks!
...R
If I understand your desired structure properly, the graphic below should illustrate the relationships you want. (Direct Link to Full-Res Image: http://cl.ly/image/0S3y3V3O0930/Screen%20Shot%202015-05-21%20at%202.28.29%20PM.png)

Navigating to a Navigation view controller via button

I have a master detail class that has a navigation view controller. I have created another view controller which I want to use to load the navigation view controller via a button. I have added a view controller and have linked a button to the navigation view controller however when i test to see if the new view loads, I receive an error on the main.m
What am i doing wrong?
I think you need not take another navigation controller if you have navigation controller for the view controller having button and you can directly take view controller which you want (UITableviewController or UIViewController). Give connection from your button to that view controller

Showing a UISplitViewController inside a pop over

I'm wanting to create a UI where I have a popover that comes from a button that and contains a split view UI with two table view controllers side by side.
The storyboard I have now has a normal page with a button, the button has a popover segue to a split view controller.
The split view controller has a master relationship to a navigation controller which has a root view controller of a table view controller.
The split view controller has a detail view controller to another navigation controller which again has a root view controller of a table view controller.
When I launch the pop up it only ever displays the master controller, not the two side by side.
UISplitViewCpntroller can only be the root view of an app - as such, you cannot put them in a UIPopover or any other non-root view.
You would have to create your own UISplitViewCpntroller type view (or look for some open source code).

Resources