Search code examples
iosuitableviewuinavigationcontrolleruisplitviewcontrollermaster-detail

Split Controller master table view pushes to master nav stack not detail


I am trying to set up a very basic Split View Controller. The left side (master) is a table view, which when a row is tapped, I expect to load details into the right side (detail).

I do not know what I'm doing wrong. I have an example project that functions exactly how I want it to, but I'm missing something in my main project. I've very carefully scoured the example project and as far as I can tell, everything is done exactly the same in my main project.

The problem I'm having is, when I tap a cell in my table view, the view controller that is invoked, appears in the master (left side), not in the detail (right side).

My question is: what exactly do I have to do to get the right side to display the detail?

I'm testing on an iPhone 7 Plus Simulator in landscape mode. Portrait mode works fine.

As far as I know I have all the correct delegate setup complete. Thanks in advance!

Basic Split View Controller Setup

Basic Split At Launch - Untouched

Basic Split after tapping the table view cell


Solution

  • Wow! Okay, I figured out what was wrong. This has got to be a bug in the storyboard UI, because it does not make sense that this would be the problem.

    When I ctrl-dragged from the table view cell to the nav controller so as to create the detail segue, I chose "show". I then realized that it should actually be "show detail", so I went into the attributes of the segue that I just created and changed "Kind" to "Show Detail (e.g. Replace)", which as far as I know, should end up being the same thing as if I would have selected "Show Detail" when creating the segue. It is not.

    After a great deal of trial-and-error, I discovered that I had to delete the segue I originally created and re-create the segue, selecting "Show Detail".

    enter image description here