cenob8 cenob8 - 1 year ago 52
iOS Question

IOS : firing multiple segues from a prototype cell in storyboards

Is there a way to connect a prototype cell to different scenes and on the didSelectRowAtIndexPath method call the [self performSegueWithIdentifier:@"NAMEOFTHESEGUE" sender:self] ?
I can't seem to drag multiple segues from the prototype cell to different scenes... I know it is possible with static cells because you can draw a segue from each cell to the scene but what if i'm using prototype cells?

I'm currently trying to implement this using the SWRevealViewController (https://github.com/John-Lluch/SWRevealViewController) plugin.
In the storyboard example project he's using a table with 3 static cells and connecting each cell to a different scene. But in my case static cells are not an option so if anyone knows the answer that would be great.

Oh and also embedding the "side panel view controller" which is a UIViewController inside a navigation controller so i can connect the navigation controller to different scenes is not an option because in that case the new scene opens inside the slide panel ...

Please take into consideration that i'm still a rookie in IOS programming.
Appreciate your time!

EDIT + solution : I had tried connecting the segues from the view controller to the scenes but it kept giving and exception "NSInvalidArgumentException - receiver has no segue with identifier..." The solution was in Xcode to go to "Product" then choose "Clean" : http://stackoverflow.com/a/14089463/1185133

Answer Source

Yes, the only thing is that you don't have to connect your prototype cell to multiple destinations, the origin of the multiple segue must be the view controller:

1 - create the segue from your Table View Controller (not the cell) to the destination VC and give to each segue an unique name.

2 - override didSelectRowAtIndexPath: and call [self performSegueWithIdentifier:@"NAMEOFTHESEGUE" sender:self]

That's all :-)