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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T08:23:23+00:00 2026-06-10T08:23:23+00:00

I’m sorry if this duplicates other threads. I’ve pored through about a dozen, over

  • 0

I’m sorry if this duplicates other threads. I’ve pored through about a dozen, over several hours, but none seem to quite apply to my situation. Namely;

  1. A button presents a popover
  2. The popover contains a table view, nested inside a navigation controller
  3. The user navigates to the second level of the nav controller (a second tableViewController), then makes a selection
  4. Upon making the selection, the popover should dismiss, and pass back the indexPath.row to the original screen.

Importantly, I’m using storyboards and segues to do this (this may be part of the problem!)

I’ve tried implementing custom delegate methods to do this, but I’m getting hopelessly tangled up. Mainly because

a) The actual delegate is two levels away, and I’m having trouble conveying this “up the chain”, as it were.
b) The [segue destinationViewController] is the navigationController. I’m not sure how to get a hook into the actual tableViews it contains, to retrieve or set properties (such as the delegate)

Does this make any sense to anyone? Reading back, this question is almost as bamboozled as I am. If you can decipher it, and have any advice, I’d be very grateful.

  • 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-10T08:23:25+00:00Added an answer on June 10, 2026 at 8:23 am

    You can get to the actual view controller (which has your table view) using the viewControllers property of your navigation controller (segue.destinationViewController). Once you have a pointer to this view controller, set its delegate. Then in tableView:didSelectRowAtIndexPath, notify the delegate that something was selected, and the delegate can dismiss the popover.

    EDIT: This could be in your prepareForSegue:

    UINavigationController *navigationController = (UINavigationController *)segue.destinationViewController; // cast the destination to UINavigationController
    
    SpeciesTableViewController *speciesViewController = [navigationController.viewControllers lastObject];
    speciesViewController.delegate = self;
    

    Apple docs about the viewControllers property of a UINavigationController:

    The view controllers currently on the navigation stack. . . . The root
    view controller is at index 0 in the array, the back view controller
    is at index n-2, and the top controller is at index n-1, where n is
    the number of items in the array.

    When using a segue, the root view controller is the only view controller, so lastObject always returns the root view controller.

    Now, keep in mind that when you select a species in SpeciesTableViewController, you’re triggering a segue, and will have to set the delegate of SpeciesDetailViewController. In SpeciesDetailViewController’s didSelectRowForIndexPath you can send a message to the delegate to dismiss the popover.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I don't have much knowledge about the IPv6 protocol, so sorry if the question
I know there's a lot of other questions out there that deal with this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I am reading a book about Javascript and jQuery and using one of the

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.