The following method is associated with a nav bar button. When the button is pressed, it shows a UIPopoverController
- (IBAction) showTablePopUp:(id) sender {
if (self.tablesPopoverController == nil) {
TablesPopOverViewController *tables = [[TablesPopOverViewController alloc]initWithNibName:@"TablesPopOverViewController" bundle:[NSBundle mainBundle]];
UIPopoverController *popover = [[UIPopoverController alloc] initWithContentViewController:tables];
popover.delegate = self;
popover.popoverContentSize=CGSizeMake(280.0, 327.0);
[tables release];
self.tablesPopoverController = popover;
[popover release];
}
[self.tablesPopoverController presentPopoverFromBarButtonItem:sender permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
}
What I want to do is hiding the popover when the button is pressed the second time:
- Click - show popover
- Click - hide popover
How can I do it?
This should do what you want: