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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T18:49:50+00:00 2026-06-03T18:49:50+00:00

I am making an iPad app where I programmatically place UIButtons on a UIImageView

  • 0

I am making an iPad app where I programmatically place UIButtons on a UIImageView inside a UIScrollView.

When someone pushes one of these buttons I would like to present a UIPopover. Since the buttons have been added programmatically, I also have to present the popover programmatically.

Here is my code for presenting the popover:

- (void)buttonHandler:(UIButton *)sender
{
    PushButtonViewController *controller = [[PushButtonViewController alloc] initWithButtonID:@"hej"];
    _pushButtonPopover = [[UIPopoverController alloc] initWithContentViewController:controller];

    _pushButtonPopover.delegate = self;

    if(![_pushButtonPopover isPopoverVisible]) {
       [_pushButtonPopover presentPopoverFromRect:sender.bounds inView:sender permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
    } else {
        [_pushButtonPopover dismissPopoverAnimated:YES];
    }
}

This is the initializer of the popover view controller:

- (id)initWithButtonID:(NSString *)buttonID
{
    self = [super init];
    self.buttonID = buttonID;
    return self;
}

The problem is that when I do so, I get an empty popover:

Screenshot 1 – not working

However, when I use a pre-inserted button, hooked up with a segue i the Storyboard, everything works just fine:

Screenshot 2 – working fine

I really hope that you might have some suggestions to what I might be doing wrong. Thank you in advance!

  • 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-03T18:49:51+00:00Added an answer on June 3, 2026 at 6:49 pm

    I seem to have found the answer myself. For some reason you have to instantiate your ViewController from the storyboard like this:

    PushButtonViewController *controller = [self.storyboard instantiateViewControllerWithIdentifier:@"Push Button Popover"];
    

    This way the view is displayed correctly.

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

Sidebar

Related Questions

I'm making an iPad web-app, and the client would like it to have two
I'm making the app-book for ipad like app-magazine. Now I'm using ScrollView and want
I am making an Ipad app and im not using the views and view
I am making some modifications to an iPad app written by somebody else and
I'm making a universal app that will run on both the ipad and the
I am making an iPad app, it currently has multiple UITableViews named like so:
I'm making an iPad app. In the app I have multiple UITextViews. I've already
I'making website which is for all desktop/iPad/iPhone. In one page I have header and
I'm currently making an OpenGL ES 2.0 drawing app for the iPad and I
I am making an iPad app that starts out in the portrait orientation but

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.