Xcode: Storyboard segues can have wrong action

Originator:indiekiduk
Number:rdar://33170765 Date Originated:7/7/2017
Status:Open Resolved:
Product:Developer Tools Product Version:8 & 9
Classification:Serious Bug Reproducible:Always
 
Summary:
Depending on the way a segue is added to the storyboard it can eventually have the wrong action tag in the xml storyboard file. For example, if when creating a segue you choose kind 'showDetail', if you use the inspector to change it to a 'show', then when you examine the xml file the segue still and incorrectly has action="showDetailViewController:sender:". This glitch has serious implications for how view controllers are presented, especially when using a split-view controller, as demonstrated in the steps to reproduce and attached sample application.

Steps to Reproduce:
1. Create a new iOS, master-detail, universal project named ShowTest.
2. Select the Main.storyboard to open it.
3. Delete the relationship segue between the top nav controller and the Master table view controller.
4. Move the Master a bit to the right to free space for a new controller.
5. Drag in a View Controller from the object library into the space.
6. Right click the primary nav controller and drag from Triggered Segues->root view controller to the new view controller.
7. Drag a button from the object library onto the new view controller.
8. Right click the button and drag from Triggered Segues->action to the Master table view controller and choose Show Detail. (It is essential that you select Show Detail at this point).
9. Select the new segue and in the inspector change its kind to Show. (this step is causing the bug to happen)
10. Run the app on the iPhone simulator (e.g. iPhone 7)
11. When the app has launched first click the button, then on next view click the +, then click on the table cell created.

Expected Results:
The detail view controller should be pushed onto the navigation controller.

Observed Results:
The detail view controller is instead shown modally. Open the Main.storyboard in a text editor, e.g. TextMate. Search for the term:
kind="show"

You will see the segue incorrectly has the action designed for a showDetail segue:
<segue destination="7bK-jq-Zjz" kind="show" action="showDetailViewController:sender:" id="w2W-0A-Kpr"/>

The segue should really be (note the showView instead of showDetailView):
<segue destination="7bK-jq-Zjz" kind="show" action="showViewController:sender:" id="w2W-0A-Kpr"/>
Or since this action is the default, just:
<segue destination="7bK-jq-Zjz" kind="show" id="w2W-0A-Kpr"/>

If you delete the segue and go back to step 8 and create the segue using show, then you will experience the correct behaviour. Thus the bug only appears when initially choosing  a showDetail segue and consequently changing it to a show.

Version:
Xcode 8 & 9
macOS 10.12.5 (16F73)

Notes:
Project in its erroneous condition is attached and is ready to run.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!