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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T06:15:29+00:00 2026-05-13T06:15:29+00:00

I have a basic question that’s driving me crazy. I have a class inheriting

  • 0

I have a basic question that’s driving me crazy.

I have a class inheriting from UITableViewController. It is the root controller in my navigation controller. I have another class that implements the UITableViewDelegate and UITableViewDataSource protocols (my delegate).

Basically, in my delegate’s tableView:didSelectRowAtIndexPath: method, I want to push a new controller.

When the delegate protocols were simply implemented by the UITableViewController, it was easy:

[self.navigationController pushViewController:nextController animated:YES];

I (obviously) can’t do that in the delegate class. How the heck do I refer to the UITableViewController subclass to get access to the navigationController? It’s driving me nuts!


Basic Flow:

  1. UITableViewController calls delegate
  2. delegate runs tableView:didSelectRowAtIndexPath:
  3. in the delegate’s tableView:didSelectRowAtIndexPath:, code needs to push new controller onto navigationController
  4. delegate does not have reference to navController or the TableViewController to do the push.
  5. code gives a compiler error if i try to pass into the delegate the tableController or navController via a property. so, i can’t give it a reference back to the calling tableViewController
  • 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-13T06:15:29+00:00Added an answer on May 13, 2026 at 6:15 am

    Your UIApplicationDelegate should have a reference to the navigation controller. You don’t actually need a reference to the UITableViewController.

    You can simply do something like this:

    // Get the App delegate
    YourAppDelegate * app = (YourAppDelegate *)[[UIApplication sharedApplication] delegate];
    
    // Get the UINavigationController used by the application
    UINavigationController * nav = app.navigationController;
    
    // Push the next view controller
    [nav pushViewController:nextController animated:YES];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

good fellas. I have another very basic question that I need help with. I
I have a basic question that I can not understand yet from ruby. If
Basic question here - I have many lines of code that look something like:
Maybe a basic question but let us say I have a string that is
This is probably a basic html/css question... I have a simple one-button form that
I have a basic question that I can't seem to resolve using Google (Or
I am a newbie to programming. I have a very basic question that Can
I have a pretty basic question that confuses me for some strange reason. I
I have a basic question here. I know that dealloc will be called when
I have a basic question: When using JUnit, in your test suite (the class

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.