-1

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.

2
  • are these all different classes of cells? or is it a reused cell?
    – gg13
    Commented Jun 19, 2013 at 4:52
  • @gg13 Different classes of cells.
    – Eduardo
    Commented Jun 19, 2013 at 4:54

3 Answers 3

1

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.

0

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.

2
  • Can you give me an example of that?
    – Eduardo
    Commented Jun 19, 2013 at 4:45
  • 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]
    – Idles
    Commented Jun 19, 2013 at 5:06
0

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.

1
  • I know I can do this, but with 61 separate cells, it's getting very messy.
    – Eduardo
    Commented Jun 19, 2013 at 5:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.