Unwind segues from UITableView cell selection do (almost) nothing

Originator:invalidname
Number:rdar://13995636 Date Originated:5/27/2013
Status:closed; not a bug Resolved:5/27/2013
Product:iPhone SDK Product Version:6.1
Classification:other bug Reproducible:always
 
my bad -- apparently, the unwind action methods needs to be declared on the VC you're going back to (or perhaps in a protocol or category to reduce coupling). so, not a bug.


27-May-2013 02:31 PM Chris Adamson:
Summary:
While it is possible to set up an unwind segue on a cell in a UITableView, it does nothing useful: it does not unwind to the previous view controller, and sometimes doesn't even call its connected action or prepareForSegue:.

Steps to Reproduce:
Unzip the attached SelectAndUnwindBuglet Xcode project. It consists of the following storyboard:

-(initial-VC)->[navigation controller]-(root-VC)->[SNFViewController]-(segue)->[SNFPickControllerViewController]

The idea of this app is that the user will press a button to bring up the table VC (SNFPickControllerViewController), pick an item from the table, and be immediately returned to the first VC, with their pick indicated.

This is set up by connecting the table cell's selection to an unwind segue, pickAndUnwind:.

Expected Results:
I expect selecting a row to call prepareForSegue, then pickAndUnwind:, and then return to the previous view controller (using whatever transition got us here in the first place: modal, nav controller push, whatever)

Actual Results:
If the segue is of type "push", prepareForSegue:and pickAndUnwind: are called, but the segue is never actually unwound. In other words, we stay on the table VC.

If the segue is of type "modal", nothing happens at all.

Regression:

Notes:
Apparently, canPerformUnwindSegueAction:fromViewController:withSender: must return YES for even the "push" case to work.

27-May-2013 02:31 PM Chris Adamson:
'SelectAndUnwindBuglet.zip' was successfully uploaded

[OpenRadar readers: sample code at https://dl.dropboxusercontent.com/u/12216224/buglets/SelectAndUnwindBuglet.zip ]

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!