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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T00:29:56+00:00 2026-06-01T00:29:56+00:00

I have the following view controller in my UIPopover: @protocol StorePopoverDelegate – (void)storeSelected:(NSString *)store;

  • 0

I have the following view controller in my UIPopover:

@protocol StorePopoverDelegate
- (void)storeSelected:(NSString *)store;
@end

@interface StorePopoverViewController : UITableViewController
{
    NSMutableArray* items;
}

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


@end

When an item is selected I want my delegate to get called:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (delegate != nil) {
        [delegate storeSelected:[items objectAtIndex:indexPath.row]];
    }
}

The delegate class that handles storeSelected is implemented:

-(IBAction)storesButtonClicked:(id)sender
{
    storesPopoverViewController = [[StorePopoverViewController alloc] initWithStyle:UITableViewStylePlain];
    storePopover.delegate = (id)self;
    storePopover = [[UIPopoverController alloc] initWithContentViewController:storesPopoverViewController]; 
    [storePopover presentPopoverFromBarButtonItem:sender permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
}

#pragma Store Popover Delegate Methods
- (void)storeSelected:(NSString *)store;
{
    NSLog(@"%@ was clicked", store);
    [storePopover dismissPopoverAnimated:YES];
}

In my - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath the delegate is nil. I’m not sure why? I am assigning it.

  • 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-01T00:29:57+00:00Added an answer on June 1, 2026 at 12:29 am

    In your storesButtonClicked: method you are setting the delegate of the storePopover (which is not even initialized at that point). You should be setting the delegate property of storePopoverViewController instead.

    storePopoverViewController.delegate = (id)self; 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am making a color picker. I have the following code: View controller.h: @interface
I have the following line in my view controller: -(void) retrieveAccounts { accounts =
I Have following code: Controller: public ActionResult Step1() { return View(); } [AcceptVerbs(HttpVerbs.Post)] public
I have the following ActionLink in my view <%= Html.ActionLink(LinkText, Action, Controller); %> and
If i have a controller action Create that returns a view with the following
I have following controller: def personalization @title = t generic.forms.personalization end def update_personalization begin
I have the following situation: From within a view controller, I go about creating
I have the following controller view method for my posts: function view($id = null)
In my loadView methoad of my view controller I have the following code: //
I have this code in my table view controller (and delegate): - (void)tableView:(UITableView *)tableView

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.