Dismiss the popover


#1

When displaying the hidden masterview from the barbutton, how can you dismiss the popover after selecting a row from the displayed table? When you tap on the detail view the popover goes away but I think it should be removed once a row is selected.


#2

Figured this out. Use the following method that is called when the popover is presented to get a pointer to the popover and set it to a UIPopover property.

-(void)splitViewController:(UISplitViewController *)svc popoverController:(UIPopoverController *)pc willPresentViewController:(UIViewController *)aViewController
{
    //Get a pointer to the popover
    [self setListPopover:pc];
}

Then when the table is called just call dismissPopover:

[[self listPopover] dismissPopoverAnimated:YES];