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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T13:20:46+00:00 2026-05-30T13:20:46+00:00

I am working on the Popover controller where I create a popover control on

  • 0

I am working on the Popover controller where I create a popover control on the click of a button and then navigate to the class where it displays a table view in a popover class.

Here I want to dismiss the pop over when I tap a table view row.

Here is my code:

//popoverclass.h
UIPopoverController *popover; 
@property(nonatomic,retain)IBOutlet UIPopoverController *popover;

//popoverclass.m
-(IBAction)ClickNext
{
    ClassPopDismiss *classCourse = [[ClassPopDismiss alloc] init];
    popover = [[UIPopoverController alloc] initWithContentViewController:classCourse];
    popover.delegate = self;
    [popover presentPopoverFromRect:CGRectMake(50,-40, 200, 300) inView:self.view permittedArrowDirections:UIPopoverArrowDirectionLeft animated:YES];
    [classCourse release];

}

//ClassPopDismiss.m
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    PopOverClass *objclass=[[PopOverClass alloc]init];
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
  [objclass.popover dismissPopoverAnimated:YES];

}

The above code is not working.

  • 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-30T13:20:47+00:00Added an answer on May 30, 2026 at 1:20 pm

    It’s not possible to dismiss popover from the same class, because the popover is presented from the class popoverclass.m and your table is in ClassPopDismiss.m .

    So the best option is to have a custom delegate method in your ClassPopDismiss.h:

    // ClassPopDismiss.h
    @protocol DismissDelegate <NSObject>
    
    -(void)didTap;
    
    @end
    

    And set an id <DismissDelegate> delegate; in your @interface section.

    Call didTap to tell PopOverClass that tableView is tapped.

    // ClassPopDismiss.m
    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath  {
        [tableView deselectRowAtIndexPath:indexPath animated:YES];
        [delegate didTap];
    }
    

    In your popoverclass.h:

    @interface PopOverClass : UIViewController <DismissDelegate>
    

    In your popoverclass.m, don’t forget to assign delegate to self. Like:

    ClassPopDismiss *classpop = [[ClassPopDismiss alloc]init];
    classpop.delegate=self;
    

    And while using the protocol method:

    -(void)didTap
    {
        //Dismiss your popover here;
        [popover dismissPopoverAnimated:YES];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on application where I want show popover in - (void)applicationWillEnterForeground:(UIApplication *)application app
Working on a project that parses a log of events, and then updates a
I am using the split view template to create a simple split view that
I have the same problem as the guy here: UIImagePickerController reloads view after its
I have a UINavigationController with a UIViewController as the RootViewController. The view controller cycles
I made a popover class that I could call easily for basic popovers -
Working on dom html . I want to convert node value to string: $html
Working on a end of the year project for school and chose to create
I am working on an iPad app. I have a viewcontroller which I want
I'm working in an iPad app that has a split view with a navigation

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.