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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T02:34:55+00:00 2026-06-05T02:34:55+00:00

I have relatively complex ui appearing in a popover (complex enough that doing all

  • 0

I have relatively complex ui appearing in a popover (complex enough that doing all the layout and relationships from code would be a pain), but the button that calls it is created and placed into the parent view (which exists in the storyboard) from code.

I’ve tried making a popover segue from the parent view’s viewcontroller object to the popover content vc, then triggering this with performSegueWithIdentifier. This almost works, but I can’t figure out how to set the popOver’s Anchor from code so it appears at the wrong place (squished at the bottom of the screen).

Is there a way to set the popOver segue’s Anchor dynamically?
or
Can i create a UIPopOverController object and get the view i’ve put together in the storyboard into it?
or
Is there some other obvious way to do this that I’m not seeing?

please be gentle, I’m new here.

iPad iOS5.1 XCode4.3.2

  • 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-05T02:34:57+00:00Added an answer on June 5, 2026 at 2:34 am

    Alex,

    I’m not completely sure I understand what you’re trying to do, but let me take a stab at it from what I think I understand.

    For the same reason you cite (view complexity, etc.), I often build out my views in the storyboard and then load them from some action. What you can do is instantiate the view controller by identifier with something like this:

    FancyViewController *controller = [[self storyboard] 
                  instantiateViewControllerWithIdentifier:@"FancyViewController"];
    

    This assumes you have created a UIViewController subclass called FancyViewController and have set the type for your view controller in the storyboard.

    Now, you can display the view controller in a popover controller or you can push it onto a navigation stack. You just need to make sure you’ve set the identifier for your view controller in the storyboard.

    enter image description here

    Also, you’ll probably want to instantiate your view controller once if you use a popover controller and just update the view controllers properties each time the action gets triggered. So, if it’s tapping a button that triggers the popover, your code might look like this:

    - (IBAction)didTapButtonToShowFancyViewController:(id)sender
    {
      if (![self fancyViewController])
      {
        // fancyViewContrller is a property of type FancyViewController *
        fancyViewController = [[[self storyboard]
              instantiateViewControllerWithIdentifier:@"FancyViewController"];
    
        // fancyViewPopoverController is also a property
        fancyViewPopoverController = [[UIPopoverController alloc] 
                      initWithContentViewController:fancyViewController];
      }
    
      // Perform setup on the fancy controller you want to do every
      // time the action gets triggered here. Do initialization in the if
      // block above.
    
      // Now display the popover from the sender's frame. I'm assuming the
      // sender is a UIButton.
      [fancyViewPopoverController presentPopoverFromRect:[sender valueForKey:@"frame"] 
                                  inView:[self view] 
                  permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
    
    }
    

    The only way to set the popover’s “anchor” dynamically is to use an explicit action that calls presentPopoverFromRect:permittedArrowDirections:animated: instead of a segue.

    I hope that helps. Let me know if I’ve misunderstood what you’re trying to do.

    Best regards.

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

Sidebar

Related Questions

I have two relatively complex queries that I am trying to join together into
I have made a simple, but relatively computationally complex, UDF that queries a rarely
I have a relatively complex layout. It consists of: A grid with one column
I have a relatively complex console application which relies on several dlls. I would
I have some relatively complex integration tests in my Python code. I simplified them
I have a relatively complex query that I'm running. I've included it below, but
The problem: I have a ListView item with a relatively complex layout. One of
I have a relatively small app that Im building using vb.net 2.0, and nant.
I have a relatively large database tables (just under a million rows) that has
I have a relatively simple question that I cannot seem to find the answer

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.