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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T03:11:10+00:00 2026-05-25T03:11:10+00:00

I have a UIPopover that I want to use either -(BOOL)popoverControllerShouldDismissPopover:(UIPopoverController *)popoverController{ return NO;

  • 0

I have a UIPopover that I want to use either

-(BOOL)popoverControllerShouldDismissPopover:(UIPopoverController *)popoverController{
    return NO;
}

or

-(void)popoverControllerDidDismissPopover:(UIPopoverController *)popoverController{}

on. Neither of them seem to work (and I’m sure once one is fixed, the other will be too since it’s probably a problem with delegates). For delegates, here is what I have:

In optionsViewController.h, the view which is inside the popover:

#import <UIKit/UIKit.h>

@protocol OptionsViewControllerDelegate <NSObject>


-(void)didPick:(NSString *)string;
@end
id delegate;


@interface OptionsViewController : UIViewController <OptionsViewControllerDelegate>{

    IBOutlet UIPickerView *picker;
    NSMutableArray *list;

}
@property (nonatomic, copy) NSArray *passthroughViews;
@property(nonatomic,retain) NSMutableArray *list;
@property(nonatomic,assign) id<OptionsViewControllerDelegate> delegate;

@end

and in the .m:

@synthesize delegate;

and in the .h of the view where the popover appears:

@interface exampleViewController : UIViewController <OptionsViewControllerDelegate,UIPopoverControllerDelegate>{
    UIPopoverController *popoverController;
    OptionsViewController *optionsViewController;
}

and in the .m:

@synthesize popoverController;
@synthesize optionsViewController;
-(BOOL)popoverControllerShouldDismissPopover:(UIPopoverController *)popoverController{
    return NO;
}

    [popoverController release];
    [optionsViewController release];

In the ViewDidLoad, I have:

if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {

        optionsViewController =[[OptionsViewController alloc]init];
        optionsViewController.delegate = self;
        popoverController = [[UIPopoverController alloc] initWithContentViewController:optionsViewController];
        popoverController.popoverContentSize = CGSizeMake(320, 216);
    }

To present the popover, I use:

-(IBAction)showDecadePopover{
    [popoverController presentPopoverFromRect:CGRectMake(150, 50, 150, 50) inView:self.view permittedArrowDirections:UIPopoverArrowDirectionLeft animated:YES];
}

I’m probably missing something really obvious (that’s why I gave so much of my code). Thanks so much!

Luke

  • 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-25T03:11:11+00:00Added an answer on May 25, 2026 at 3:11 am

    Yep, simple fix. After you init the popoverController you need to set the exampleViewController as the delegate of it.

     [popoverController setDelegate:self];
    

    PS: What is the id delegate; floating after your OptionsViewControllerDelegate protocol definition for? Synthesizing delegate, which you already do, is all you need to create storage for it.

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

Sidebar

Related Questions

I have the following view controller in my UIPopover: @protocol StorePopoverDelegate - (void)storeSelected:(NSString *)store;
Have an app that can use tts to read text messages. It can also
I have created custom jQuery UI widget called uiPopover, very similar to UI-dialog (in
Have a SomeLib.pro file that contains: CONFIG += debug TEMPLATE = lib TARGET =
Have a matrix report now that has Position, Hours and Wages for a location
I have an iPad app that I would like to make Universal, however this
Is it possible to have the keyboard show inside a UIPopOver instead of filling
Have finally got a responsive site working (of a fashion). What I want to
Have a look at one of my websites: moskah.com The problem is that it
Have a simple contact us XPage created. Have server side validation in place that

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.