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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T22:54:26+00:00 2026-06-04T22:54:26+00:00

I could use some help with custom delegates. I’m trying to make a protocol

  • 0

I could use some help with custom delegates. I’m trying to make a protocol that sends a message to its delegate to dismiss the popover view. Here is what I’m trying.

In the popoverViewController.h

#import <UIKit/UIKit.h>


@protocol MyPopoverDelegate <NSObject>
-(void) didSelectLanguage;
@end



@interface Popover : UITableViewController{

    id <MyPopoverDelegate> delegate;
    NSMutableArray *languageData;

}

@property (nonatomic, assign) id <MyPopoverDelegate> delegate;

@end

.m

@synthesize delegate;

...

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    NSLog(@"You selected %@", [languageData objectAtIndex:[indexPath row]]);
    [self.delegate didSelectLanguage];

}

...

And in the ViewController that presents the popover

#import <UIKit/UIKit.h>
#import "popoverViewController.h"




@interface ChoicesChoices : UIViewController <UIPopoverControllerDelegate, MyPopoverDelegate>{

    UIPopoverController *popover;




}
- (IBAction)facebook:(id)sender;
- (IBAction)twitter:(id)sender;
- (IBAction)sms:(id)sender;
- (IBAction)copy:(id)sender;
- (IBAction)email:(id)sender;
- (IBAction)home:(id)sender;
- (IBAction)mute:(id)sender;
- (IBAction)note:(id)sender;


@property (nonatomic, retain) UIPopoverController* popover;


@end

and .m

@synthesize popover;

...

- (void)didSelectLanguage{
[popover dismissPopoverAnimated:YES];
NSLog(@"didSelectLanguage fired");
}

When I select a row in the table of the popover, didSelectLanguage does not get called. Any ideas on what I might be doing wrong? Thanks for your help.

  • 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-04T22:54:27+00:00Added an answer on June 4, 2026 at 10:54 pm

    Make sure you are setting your delegate to the be the view controller that is presenting your popover. Something like this in ChoicesChoices.m:

    - (void)presentPopover
    {
      // assuming ARC for all allocations
        Popover *myController = [Popover new];
        myController.delegate = self;
        self.popover = [[UIPopoverController alloc] initWithContentViewController:myController];
        [self.popover presentPopover...];  // two flavors here, FromRect: and FromBarButtonItem:, that's left up to you to choose which one is correct.
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Could use some help with Regex searching with NetBeans 7.01's find function. I'm trying
I could use some help understanding something puzzling to me. It concerns the position
I could use some help with expression conversion. I have a method on a
i have an issue i could use some help with, i have python list
I'm new to SQL and could use some help in creating a database schema
I am currently working on a mobile website and I could use some help
I'm just starting to learn T-SQL and could use some help in understanding what's
I am a absolute PHP n00b, so i could use some help with a
I could really use some help here. I just created a new bare repo
I could use some advice/help on a piece of software I've developed. The application

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.