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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T23:11:07+00:00 2026-06-03T23:11:07+00:00

I am creating and iPad application using XCode version 4.3.2. I am having trouble

  • 0

I am creating and iPad application using XCode version 4.3.2. I am having trouble figuring out how to close a popover that is created in a storyboard.

On my main screen I have a button. On the storyboard, I have a segue defined from that button to my popover. My popover is a table view controller. After selecting an item in the popover table view, I am sending the selected information back to the parent and attempting to close the popover. Everything works except I cannot get the popover to close.

The code for the main screen .m file:

#import "SectionViewController.h"
#import "SortByTableViewController.h"

@interface SectionViewController () <SortByTableViewControllerDelegate>
@end

@implementation SectionViewController

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    if ([segue.identifier isEqualToString:@"DisplaySortByOptions"]) 
    {
        SortByTableViewController *popup = (SortByTableViewController*)segue.destinationViewController;
        popup.selectedSection = self.selectedSection;
        popup.receivedOption = self.selectedItemCharacteristic;
        popup.delegate = self;
    }
}

- (void)sortByTableViewController:(SortByTableViewController *)sender 
                           returnedOption:(ItemCharacteristic *)returnedOption
{
    if(!returnedOption)
    {
        [self.sortByButton setTitle:@"SHOW ALL" forState:UIControlStateNormal]; 
    }
    else 
    {
        [self.sortByButton setTitle:returnedOption.name forState:UIControlStateNormal];
    }
    self.itemCharacteristic = returnedOption;
    [self dismissViewControllerAnimated:YES completion:nil]; //THIS DOES NOT CLOSE THE POPOVER
}

The code for the popover .h file:

#import <UIKit/UIKit.h>

@class SortByTableViewController;

@protocol SortByTableViewControllerDelegate <NSObject>

- (void)sortByTableViewController:(sortByTableViewController *)sender 
                           returnedOption:(ItemCharacteristic *)returnedOption;

@end

@interface SortByTableViewController : UITableViewController

@property (nonatomic, strong) Section *selectedSection;
@property (nonatomic, strong) ItemCharacteristic *receivedOption;
@property (nonatomic, weak) id <SortByTableViewControllerDelegate> delegate;

@end

The code for the popover .m file:

#import "SortByTableViewController.h"

@interface SortByTableViewController () <UITableViewDelegate>

@end

@implementation SortByTableViewController

@synthesize selectedSection = _selectedSection;
@synthesize receivedOption = _receivedOption;
@synthesize delegate = _delegate;

...
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    ItemCharacteristic *itemCharacteristic = [self.fetchedResultsController objectAtIndexPath:indexPath];
    [self.delegate sortByTableViewController:self returnedOption:itemCharacteristic];
    [self dismissViewControllerAnimated:YES completion:nil]; //THIS DOESN'T WORK
    [self.navigationController popViewControllerAnimated:YES]; //THIS DOESN'T WORK EITHER
}

@end

Thanks for any help or guidance.

  • 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-03T23:11:08+00:00Added an answer on June 3, 2026 at 11:11 pm

    I found the answer. I had to add the following property to my main screen:

    @property (nonatomic, strong) UIPopoverController *sortByPopoverController;
    

    Then, when launching the popover, I included this:

    UIStoryboardPopoverSegue *popoverSegue = (UIStoryboardPopoverSegue *)segue;
    self.sortByPopoverController = popoverSegue.popoverController;
    

    Including that code allowed me to properly dismiss the popover when the delegate called back:

    [self.sortByPopoverController dismissPopoverAnimated:YES];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating an iPad application that supports ONLY LANDSDCAPE mode. I'm using storyboards. Even
I am creating an iPad application for ios 5 using arc and storyboard in
I am creating an iPad application using a UISplitView. I used the default template
we are creating an application using HTML5 for Iphone, IPAD and Android. Now the
I'm creating a phonegap application for multiple platforms (specifically, Playbook and iPad) that requires
I'm creating an IPad application using C#, Mono develop and Monotouch. I've been using
I am creating an iPad application, in that i have to use different PDF
i am creating one iPad application in that i want to open media player
We are creating an iPad application that uses multiple SplitViewController. From the Apple documentation
I am creating an iPad application that behaves like a power point presentational. I

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.