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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T02:57:58+00:00 2026-05-20T02:57:58+00:00

I have a UITabBarController which has on one of its tabs, a UINavigationController. The

  • 0

I have a UITabBarController which has on one of its tabs, a UINavigationController. The UINavigationController then has a custom UIViewController as its main view.

Based on an IBAction triggered by a button in the custom UIViewController I’m pushing a UITableView controller onto the UINavigationController stack like so. (Note: these are only snippets of the actual code).

Header file for main UIViewController:

@interface ATMs : UIViewController <CLLocationManagerDelegate, NSFetchedResultsControllerDelegate, MKMapViewDelegate> {
}
- (IBAction) showLocationList;
@end  

Implementation file for main UIViewController:

@implementation ATMs
- (void)showLocationList {

    LocationList *locationTableController = [[LocationList alloc] initWithNibName:@"LocationList" bundle:nil];

    [self.navigationController pushViewController:locationTableController animated:YES];
    [locationTableController release];

}

The locationTableController view controller does a fetch to Core Data for a list of objects and displays them on the table. When a user selects a row, I want the following things to happen:

  • pop the locationTableController off the navigation controller so that my ATMs view controller is visible
  • call a method in ATMs, passing in the object represented by the row tapped in locationTableController

I tried to do this by using the [locationTableController setDelegate:self]; in showLocationList just beneath where I alloc the UITableViewController and adding the UITableViewDelegate to the header for ATMs.
But when I do the above, I get a build error saying that locationTableController may not respond to setDelegate.

  • 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-20T02:57:58+00:00Added an answer on May 20, 2026 at 2:57 am

    In simple terms and without examining the rest of your code, you need to instantiate the UITableViewController and set its tableView (not the TableViewController) delegate as self.

    Then you can implement - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath in your ATM UIViewController and it will be called once a row is selected in your tableView.

    I’d also present your tableViewController modally as per code below, and declare it as an instance variable so you can dismiss it when the tableview delegate method is called:

    @class LocationList
    @interface ATMs : UIViewController
    {
       LocationList *locationTableController
       ...
    }
    

    And in your implementation:

    @implementation ATMs
    ...
    - (void)showLocationList 
    {
        locationTableController = [[LocationList alloc] initWithNibName:@"LocationList" bundle:nil];
        locationTableController.tableView.delegate = self;
        [self presentModalViewController:locationTableContrller animated:YES];
        [locationTableController release];
    }
    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
    {
        [locationTableController dismissModalViewControllerAnimated:YES];
        // Rest of your implementation code here
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a UITabBarController with five views, one of which has a UINavigationController within
I have a UITabBarController which has 3 UINavigationController s and 2 UIViewController , the
I have an app that has a UINavigationController that pushes a UITabBarController into view.
I have an UITabBarController with two tabs: UINavigationController OptionsViewController : UIViewController How can I
i have a uitabbarcontroller which has 3 items. each item has its own navigation
I have an app which has a UITabBarController, and when different tabs are pressed,
I have a UITabBarController with 4 views/tabs. Each view is a UINavigationController. How can
I have a UITabBarController in my MainWindow.xib. Each tab contains a UINavigationController which has
I have 3 subviews in a UITabBarController. The first tab's view has objects which
I have a UITabBarController that holds several tabs of which one tab (third Tab,

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.