Robert Richardson Robert Richardson - 2 months ago 21
iOS Question

iPhone SDK Storyboard - Pass Table string to previous segue?

I have a main ViewController that has two buttons that each segue to their own table view. The table view cells have a title and a subtitle and I have managed to load my content into them.

When I click the item, I want it to bring me back to my main view controller along with the title string and the subtitle string.

Should I be using a push segue or modal segue?

On my main view controller I have Labels that I want the strings to change to.

If you need more information, let me know.


You should likely use neither a push, nor a modal segue if you want to go "back" to the main view controller. So long as this is contained within a navigation controller, it sounds like what you want to do is forward the data you collected from the cell to the main view controller somehow, and then pop the current view off the navigation stack.

If you were to use a push segue, then the main view controller would be on the navigation stack twice.

If you were to use a modal segue, you might end up with numerous navigation stacks floating around in modal view controllers all over the place.