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

  • Home
  • SEARCH
  • 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 9167879
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T15:29:55+00:00 2026-06-17T15:29:55+00:00

I have a UITableViewController within a UIViewController . While this table viewcontroller was the

  • 0

I have a UITableViewController within a UIViewController. While this table viewcontroller was the only one involved, it was pushing views just fine when the user would tap a row. However, ever since I moved it to be one of two contained within the UIViewController, the taps of rows suddenly do nothing.

I’ve tried searching around and I’m not the first to run into this problem, but none of the answers fit my circumstances or the questions have no working answers. That link was the closest I found, but I’m not using storyboards — I’m using separate XIBs.

So how do I push a new view from a viewcontroller within a viewcontroller?

To recap:

  1. Here is what I had, and it worked fine in taking users to a new screen!

    // Normal table behavior, as illustrated by [another question][2].
    
    - (void)tableView:(UITableView *)tableView 
    didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    
        SomeView *detailViewController = [[SomeView alloc] initWithNibName:@"SomeView" bundle:nil];
    
        // Pass the selected object to the new view controller.
        [self.navigationController pushViewController:detailViewController animated:YES];
    }
    
  2. Now I have the viewcontroller as a property in a view — and the above code, which is in the file for the tableviewcontroller and not at the “main” view, doesn’t cause a new screen to appear anymore!


Thanks for the comments! Here’s some code to clarify my scenario.

  1. The controllers within a controller. This is a file from a test project I’ve been using to test the concept out. In this case, I have a tableview controller within a tableview controller.

    @interface SimpleTableViewController : UIViewController <UITableViewDelegate, UITableViewDataSource>
    
    // This is the controller within the controller
    @property IBOutlet SecondTableViewController *secondTableController;
    @property IBOutlet UITableView *secondTable;
    
  2. My SecondTableViewController has this fun bit.

    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
    {
        // Navigation logic may go here. Create and push another view controller.
    
        UIViewController *detailViewController = [[UIViewController alloc] initWithNibName:@"SimpleNonTableViewController" bundle:nil];
        // ...
        // Pass the selected object to the new view controller.
        [manualViewControllerParent.navigationController  pushViewController:detailViewController animated:YES];
    }
    

The view that the user interacts with is hooked up to SimpleTableViewController. In this way, SecondTableViewController is “within” SimpleTableViewController. Feel free to comment if you’d like more details!


I’ve put my test/concept project on github. https://github.com/hyliandanny/TableViewCeption

  • 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-17T15:29:56+00:00Added an answer on June 17, 2026 at 3:29 pm

    You need to use a custom container controller to do what you want. It would be easiest if you used a storyboard, but you can do it in code with xibs as well. The outer controller should be a UIViewController, not a table view controller. You can do something like this (in the outer controller):

    - (void)viewDidAppear:(BOOL)animated {
        [super viewDidAppear:animated];
        UIViewController *detailViewController = [[UIViewController alloc] initWithNibName:@"SimpleNonTableViewController" bundle:nil];
        [self addChildViewController:detailViewController];
        detailViewController.view.frame = set the frame to what you want;
        [self.view addSubview:detailViewController.view];
        [detailViewController didMoveToParentViewController:self];
    }
    

    You should read up on Apple’s documentation for custom container controllers.

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

Sidebar

Related Questions

I do not manage to have iAd working in storyboard, within a UITableViewController. This
I have a view controller (derived from UIViewController not UITableViewController) containing a table view.
I have a UITableviewController and I push another UIViewController in 'didSelectRow..' method. I have
I have a UITableViewController that displays cells that are just default. Each cell can
I have an UITableViewController which I would like to add UIToolbar to with one
I have a UITableViewController and UITableViewCell . This cell contains three text fields. Each
On iOS 5 I Have a UITableViewController set to Static Cells. I only need
I have a regular UITableViewController and a UITableView as its only view, and I
I have a UITableViewController containing some very basic data. Assume each row just contains
I have a UITableViewController that works in both portrait and landscape. From this controller

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.