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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T17:09:59+00:00 2026-05-14T17:09:59+00:00

I’ve set up a grouped table on my app, and pushing to new views

  • 0

I’ve set up a grouped table on my app, and pushing to new views works fine. Except for one thing. The titles and stack layout are all weird. Here’s the breakdown:

  1. I have two sections in my table.
  2. When I tap on the first row in the first section, it takes me to the correct view, but the title of the new view is the name of the first row in the second section of the table.
  3. In turn, the second row in the first section’s title is the second row in the second section’s title.

If I tap on the second row in the second section of the root view table, the navigation button goes to the second row in the first section of the table.

So here’s a diagram of my table:


Table Section 1
Row 1
Row 2
Row 3

Table Section 2
Row A
Row B
Row C


So if I tap on row 3, the title of the pushed view is Row C. The navigation button tells me to go back to Row 3, then eventually ending up at the root view.

Here’s my implementation file pushing the views:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

    //CSS
    if ([[arryClientSide objectAtIndex:indexPath.row] isEqual:@"CSS"])
    {
        CSSViewController *css = [[CSSViewController alloc] initWithNibName:@"CSSViewController" bundle:nil];
        [css setTitle:@"CSS"];
        [self.navigationController pushViewController:css animated:YES];
    }

    //HTML
    if ([[arryClientSide objectAtIndex:indexPath.row] isEqual:@"HTML"])
    {
        HTMLViewController *html = [[HTMLViewController alloc] initWithNibName:@"HTMLViewController" bundle:nil];
        [html setTitle:@"HTML"];
        [self.navigationController pushViewController:html animated:YES];
    }

    //JS
    if ([[arryClientSide objectAtIndex:indexPath.row] isEqual:@"JavaScript"])
    {
        JSViewController *js = [[JSViewController alloc] initWithNibName:@"JSViewController" bundle:nil];
        [js setTitle:@"JavaScript"];
        [self.navigationController pushViewController:js animated:YES];
    }

    //PHP
    if ([[arryServerSide objectAtIndex:indexPath.row] isEqual:@"PHP"])
    {
        PHPViewController *php = [[PHPViewController alloc] initWithNibName:@"PHPViewController" bundle:nil];
        [php setTitle:@"PHP"];
        [self.navigationController pushViewController:php animated:YES];
    }

    //SQL
    if ([[arryServerSide objectAtIndex:indexPath.row] isEqual:@"SQL"])
    {
        SQLViewController *sql = [[SQLViewController alloc] initWithNibName:@"SQLViewController" bundle:nil];
        [sql setTitle:@"SQL"];
        [self.navigationController pushViewController:sql animated:YES];
    }

& the array feeding the table’s data:

- (void)viewDidLoad {
    [super viewDidLoad];


    arryClientSide = [[NSArray alloc] initWithObjects:@"CSS",@"HTML",@"JavaScript",nil];
    arryServerSide = [[NSArray alloc] initWithObjects:@"Objective-C", @"PHP",@"SQL",nil];
    // arryResources = [[NSArray alloc] initWithObjects:@"HTML Colour Codes", @"Useful Resources", @"About",nil];
    self.title = @"Select a Language";
    [super viewDidLoad];

    // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
    // self.navigationItem.rightBarButtonItem = self.editButtonItem;
}

Any help would be greatly appreciated.
Jack

  • 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-05-14T17:10:00+00:00Added an answer on May 14, 2026 at 5:10 pm

    I think you are missing an if statement to determine which section the user tapped on. Remember that NSIndexPath has both a row and a section property. I usually do something like this:

    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    if ( indexPath.section == 0 ) {
      // Do something with arryClientSide
    }
    if ( indexPath.section == 1 ) {
      // Do something with arryServerSide
    }
    

    I’m assuming you are using a grouped table.

    Cheers,
    -dan

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I am writing an app with both english and french support. The app requests
I am using Paperclip to handle profile photo uploads in my app. They upload
I'm making a simple page using Google Maps API 3. My first. One marker
I have just tried to save a simple *.rtf file with some websites and

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.