Instead of control-dragging every cell to the other view controller, is there a way to make them all segue to the view controller more easily? I would also need to add a Segue Identifier to the individual segues as well.
3 Answers
That is exactly why you have a tableview delegate method.
– tableView:didDeselectRowAtIndexPath:
whatever cell in the table this method will get invoked and there you can call for whichever transition like push,model etc programmatically in code.
This sounds like something you should do programmatically rather than in interface builder. You'll want to set the selection action for the cells to trigger the Segue.
-
-
You probably have a UITableViewDelegate, so you should implement its callback method for cell selection. This allows you to listen to a click event on any cell, regardless of its class. If the cells need to perform different segues, then you can determine which one based on the cell class or its contents. Then you'd call
[self performSegueWithIdentifier:identifierNSStringPointer sender:self]
– IdlesCommented Jun 19, 2013 at 5:06
You can create a manual segue from one view controller to another. Just select view controller from the bottom bar (where you see first responder and all) and ctrl drag to other view controller. Select the segue and give it a unique identifier (TransitionSegue in this example) from attributes inspector. From code call the segue whenever you want a transition.
[self performSegueWithIdentifier: @"TransitionSegue" sender: self];
Hope this helps.
-
I know I can do this, but with 61 separate cells, it's getting very messy.– EduardoCommented Jun 19, 2013 at 5:02