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 9098907
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T00:28:44+00:00 2026-06-17T00:28:44+00:00

Can someone tell me how to assign a interface to a table view element,

  • 0

Can someone tell me how to assign a interface to a table view element, using storyboards? I’m making a medical calculator that has different calculators for every equation, and I need help making code that points a element to push to another interface. This is because for every equation, there are different fields to fill out (such as age, oxygen levels, whether someone has diabetes or not, height, etc.) Not every equation needs the same fields.

I have tried doing this:

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    // Deselect row
    [tableView deselectRowAtIndexPath:indexPath animated:YES];

    // Declare the view controller
    UIViewController *anotherVC = nil;

    // Determine the row/section on the tapped cell
    switch (indexPath.section) {
        case 0:
            switch (indexPath.row) {
                case 0: {
                    // initialize and allocate a specific view controller for section 0 row 0
                    anotherVC = [[BmiViewController alloc] init];
                    break;
                }
                case 1: {
                    // initialize and allocate a specific view controller for section 0 row 1
                   /anotherVC = [[AaOxygenGradientViewController alloc] init];
                    break;
                }
            }
            break;
    }
}

But after doing this, it refers back to what was originally in the storyboard document (which is empty because I have created the interface programmicatally), instead of showing my test alert popup.

Also, is it possible to maybe make a bunch of table view cells, then have every one segue to every other view controller in the storyboard?

Thanks a lot in advance!

  • 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-17T00:28:45+00:00Added an answer on June 17, 2026 at 12:28 am

    First, you are running deselectCellAtIndexPath? What is the reason for this? If you are just trying to remove the blue highlight then it’s better to change the UITableViewCellSelectionStyle (or something like this) of the cell.

    I’m not sure what you’re asking for the first part but for the segue part then yes.

    In Storyboard set up the segues from the tableViewController to each other VC that you want to segue to and give them all sensible identifiers.

    i.e. medicalCalulatorSegue
    graphSegue
    userDetailsSegue
    etc…

    Then in your didSelect method you will have something like…

    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
    {
        //some stuff...
    
        switch(indexPath.row) {
            case 0:
                [self performSegueWithIdentifier:@"medicalCalulatorSegue"];
                break;
            case 1:
                [self performSegueWithIdentifier:@"graphSegue"];
                break;
            case 2:
                [self performSegueWithIdentifier:@"userDetailsSegue"];
                break;
        }
    }
    

    This will then segue to each of the different view controllers depending on which cell is selected.

    The reason for not deselcting the cell is that in your method prepareForSegue you can then still access the indexPath of the selected cell…

    NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can someone tell me how I can make a table be 100% height in
Could someone tell me how can I assign 2 column values to the JComboBox
Can someone tell me if there is a webpage that lists the official Google
Can someone tell me why I can't select the table tab? Here is a
Can someone tell me the exact difference between node() and element() types in XQuery?
can someone tell me what the difference between assigning event handlers using bind(): $(function
Can someone tell me how i can change the .xml file that a flash
Can someone tell me how to modify this regex to allow periods in a
can someone tell me what seems to be the issue with this <?php $increment
can someone tell me the order in which a thread starts to execute?. I

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.