Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9181119
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T18:12:39+00:00 2026-06-17T18:12:39+00:00

Ok, so I have a UITableViewController. In it I have dynamic tableviewcell defined. For

  • 0

Ok, so I have a UITableViewController. In it I have dynamic tableviewcell defined. For now to make things simple lets say there are three dynamic rows defined. see screenshot

enter image description here

So what I am want to do is that when user touches

  • row 1, I want to take them to viewcontroller1
  • row 2, I want to take them to viewcontroller2
  • row 3, I want to take them to viewcontroller3

Now here’s the dilemma part, when I select the prototype cell and connect it to viewcontroller1 using modal then from then onwards any row I touch it will always take me to viewcontroller1. I thought of writing this code for my UITableViewController but I don’t know how to create multiple sages? (see below)

Now it may very well be that this is a limitation of storyboard and UITableView and it cannot be done using dynamic cell. What I will have to do is create static cells and manually connect each of the rows to the corresponding view controller. I just wanted to know if there is an easier way as I got 50 rows and each row needs to be connected to a new view controller. Yes I love connecting stuff in storyboard that much. Just wanted to get a second opinion if there are any better approaches.

    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
    {
        // Navigation logic may go here. Create and push another view controller.

        //SECTION #0
        if (indexPath.section == 0)
        {
            [self performSegueWithIdentifier:@"goto1" sender:nil];

        }

    //SECTION #1
        if (indexPath.section == 1)
        {
            [self performSegueWithIdentifier:@"goto2" sender:nil];

        }

    //SECTION #2
        if (indexPath.section == 2)
        {
            [self performSegueWithIdentifier:@"goto3" sender:nil];

        }

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T18:12:40+00:00Added an answer on June 17, 2026 at 6:12 pm

    It’s also possible to drag a segue from the yellow controller icon in the controller toolbar. Select your table view controller and a black toolbar like pictured below will show up.

    Controller Toolbar

    Drag from the yellow icon to the desired destination controller.

    This way a segue is not directly attached to a cell or anything else. Give it an identifier and you can perform it in code whenever you want.

    In your case you call performSegueWithIdentifier:sender: in tableView:didSelectRowAtIndexPath: based on whatever logic you seem fit.

    [edit]:

    “Just wanted to get a second opinion if there are any better approaches.”

    50 different segues & destinations seems an awful lot. Are you sure you’re not able to reuse a single (or at least less than 50) view controller(s) (say when only the content differs?). For example you display 50 similar pages with content. Instead of creating 50 view controllers in your storyboard: create a single one and set the content of the view controller before it is shown:

    - (void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
        MyPageController *page = (MyPageController *)segue.destinationViewController;
        // get content for selected row
        page.content = myContentModelObject;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a UITableViewController and UITableViewCell . This cell contains three text fields. Each
Hey guys, (relatively, I believe) simple question here, I have a UITableViewController with its
I have UITableViewController with static editable cells. In my UITableViewController I make CoreData object,
I have UITableViewController which contains a list of items. Now, I want the list
I have a UITableViewController, a bunch of sections and rows, and for each row
Say I have UITableViewController A, and UITableViewController B. Both A and B loads UIView
I have a dynamic cell UITableViewController and I want to push a specific View
I have an UITableViewController , set up so that users can delete rows. This
I have UITableViewController as the RootViewController. I need to add rows to the table
I have UITableViewController (initiated by the Navigation-based app project template). I am overriding loadView

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.