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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T20:30:37+00:00 2026-06-17T20:30:37+00:00

I need to perform a Popover segue when user touches a cell in a

  • 0

I need to perform a Popover segue when user touches a cell in a dynamic TableView. But when I try to do this with this code:

- (void)tableView:(UITableView *)tableview didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
        [self performSegueWithIdentifier:@"toThePopover" sender:[tableView cellForRowAtIndexPath]];
    //...
} 

than I get an error:

Illegal Configuration

Popover segue with no anchor

Is there any way to do this (to perform a popover segue from dynamic TableView manually)?

  • 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-17T20:30:39+00:00Added an answer on June 17, 2026 at 8:30 pm

    I was faced with this same issue tonight, there a couple workarounds (including presenting the popover the old fashioned way).

    For this example, I have an object that is stored in my custom cell class. When the cell is selected I call a function like this to open details in a popOverViewController about the object, and point (anchor) to it’s corresponding cell in the table.

        - (void)openCustomPopOverForIndexPath:(NSIndexPath *)indexPath{
            CustomViewController* customView = [[self storyboard] instantiateViewControllerWithIdentifier:@"CustomViewController"];
    
            self.myPopOver = [[UIPopoverController alloc]
                                       initWithContentViewController:customView];
            self.myPopOver.delegate = self;
            //Get the cell from your table that presents the popover
            MyCell *myCell = (MyCell*)[self.tableView cellForRowAtIndexPath:indexPath];
            CGRect displayFrom = CGRectMake(myCell.frame.origin.x + myCell.frame.size.width, myCell.center.y + self.tableView.frame.origin.y - self.tableView.contentOffset.y, 1, 1);
            [self.myPopOver presentPopoverFromRect:displayFrom
                                                 inView:self.view permittedArrowDirections:UIPopoverArrowDirectionLeft animated:YES];
        }
    

    The problem with this method is that we often need the popover view to have a custom initializer. This is problematic if you want your view to be designed in storyboard instead of a xib and have a custom init method that takes your cells associated object as a parameter to use for it’s display. You also can’t just use a popover segue (at first glance) because you need a dynamic anchor point (and you can’t anchor to a cell prototype). So here is what I did:

    1. First, create a hidden 1px X 1px UIButton in your view controllers view. (important to give the button constraints that will allow it to be moved anywhere in the view)
    2. Then make an outlet for the button (I called mine popOverAnchorButton) in your view controller and control drag a segue from the hidden button to the view controller you wish to segue to. Make it a popOver segue.

    Now you have a popover segue with a ‘legal’ anchor. The button is hidden, so no one can touch it accidentally. You are only using this for an anchor point.

    Now just call your segue manually in your function like this.

        - (void)openCustomPopOverForIndexPath:(NSIndexPath *)indexPath{
            //Get the cell from your table that presents the popover
            MyCell *myCell = (MyCell*)[self.tableView cellForRowAtIndexPath:indexPath];
    
            //Make the rect you want the popover to point at.
            CGRect displayFrom = CGRectMake(myCell.frame.origin.x + myCell.frame.size.width, myCell.center.y + self.tableView.frame.origin.y - self.tableView.contentOffset.y, 1, 1);
    
            //Now move your anchor button to this location (again, make sure you made your constraints allow this)
            self.popOverAnchorButton.frame = displayFrom;
            [self performSegueWithIdentifier:@"CustomPopoverSegue" sender:myCell];
        }
    

    And…… Voila. Now you are using the magic of segues with all their greatness and you have a dynamic anchor point that appears to point to your cell.
    now in -(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender you can simply cast the sender to your cell’s class (given that you do the proper checks on sender type and which segue is being called) and give the segue’s destinationViewController the cell’s object.

    Let me know if this helps, or anyone has any feedback or improvements.

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

Sidebar

Related Questions

I need to perform this operation many times on my data: public void AddBehavior(BehaviorTypes
i need to perform an operation (in this case DATEDIFF()) on 2 dates. But
I need to perform [[self tableView] reloadSections:[NSIndexSet indexSetWithIndex:1] withRowAnimation:UITableViewRowAnimationNone]; after - (void)controllerDidChangeContent:(NSFetchedResultsController *)controller {
I need to perform following steps: Let user write own code - no problem,
I need to perform a query 2.5 million times. This query generates some rows
I need to perform a database restore from my application. Before doing this, I
I need to perform an action on double click of a text box, but
I need to perform relatively frequent bulk updates/imports using the JIRA REST API. This
I need to perform some action in wordpress admin panel programmatically but can't manage
I need to perform this query: SELECT * FROM (SELECT * FROM product WHERE

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.