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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T00:29:34+00:00 2026-06-03T00:29:34+00:00

I have two UITableViewControllers. In the first UITableView, once a user selects a cell,

  • 0

I have two UITableViewControllers. In the first UITableView, once a user selects a cell, a new UITableViewController is pushed. I have set both UITableViews to “Grouped” in IB. However, when the second UITableViewController is pushed, it appears as a “Plain” UITableView. Is there a way to fix this?

Just as a sanity check, I changed the code so that the second UITableViewController is pushed not from the first UITableViewController, and it does appear to be “Grouped”. Is there a reason this is happening?

Code From UITableViewController that is pushing second UITableViewController:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];

   if ([cell.text isEqualToString:@"Long Term Disability"]) { 
    LongDisabilityTableView *ldvc = [LongDisabilityTableView alloc]; 
    [self.navigationController pushViewController:ldvc animated:YES];
   }
    if ([cell.textLabel.text isEqualToString:@"Short Term Disability"]) {

        ShortDisabilityTableView *sdvc = [ShortDisabilityTableView alloc]; 
        [self.navigationController pushViewController:sdvc animated:YES];
    }

}
  • 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-03T00:29:36+00:00Added an answer on June 3, 2026 at 12:29 am

    If you are pushing to a UITableViewController, you can force the table to be grouped by doing one of the following:

    Init

    MyTableController *grouped = [[MyTableController alloc] initWithStyle:UITableViewStyleGrouped];
    

    Super

    This needs to be added to a UITableViewController.

    - (id)initWithStyle:(UITableViewStyle)style
    {
        self = [super initWithStyle:UITableViewStyleGrouped]; /* This is where the magic happens */
        if (self) {
            self.title = @"My Grouped Table";
        }
        return self;
    }
    

    Double Check

    Make sure that you are not placing your UITableView on a UIViewController.

    Make sure that you are calling the correct controller in your code (from didSelectRowAtIndexPath:)

    Update, added after code

    Well there’s one reason right there, you aren’t using init. See my first example above.

    You should also change your code to this:

    /*  This assumes that your Long Term Disability cell is at index 0
        and that your Short Term Disability cell is at index 1. 
     */
    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
    {
        switch ( indexPath.row )
        {
            case 0: /* @"Long Term Disability" */
    
                LongDisabilityTableView *ldvc = [[LongDisabilityTableView alloc] initWithStyle:UITableViewStyleGrouped]; 
                [self.navigationController pushViewController:ldvc animated:YES];
                break;
    
            case 1: /* @"Short Term Disability" */
    
                ShortDisabilityTableView *sdvc = [[ShortDisabilityTableView alloc] initWithStyle:UITableViewStyleGrouped];
                [self.navigationController pushViewController:sdvc animated:YES];
                break;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a navigation controller that works with two UITableViewControllers. The first UITableViewController shows
I have two UITableViewControllers such that when I click next on the first UITableViewController,
In my 'Sectioned' UITableView I have two sections, the first one for Attributes like
I have a UINavigationController with two UITableViewControllers pushed onto its stack. Is there any
I have a UITableViewController which has two sections. The first section shows a single
I have a UINavigationController with two UITableViewControllers (A and B). A is displayed first
I have two UITableViewControllers with a fairly simple ui flow. One UITableViewController loads another
So I have two UITableViews in my ViewController, how do I set the delegate
I have a SplitViewController which has two UITableViewControllers - one master/root one detail. Everything
I'm creating an iPad app, and I have two classes: NWRootViewController : UITableViewController 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.