0

I have a popover view in my app which is opened by a UIBarButtonItem, however if I continue to tap that button, it will just create more and more popovers, but I only want one of course, not loads of duplicates!

How can I handle this?

Thanks.

Josh Kahane
  • 16,765
  • 45
  • 140
  • 253

2 Answers2

1

Keep a reference to the UIPopoverController you have on the screen (you can do this by having an ivar). When you click the button, check it exists, if yes, then close it and release it.

Rui Peres
  • 25,741
  • 9
  • 87
  • 137
0

Josh,

unfortunately, this is not an answer, only a reference to the same question I posted.

UIPopoverController not dismissed when opened from self.navigationItem (inside UINavigationController)

Hoping to get answers for all of them in this manner.

If someone can tell me how to attach comments to questions - that's the better place for hints like this, I guess.

Regards, nobi

Community
  • 1
  • 1
virtualnobi
  • 1,140
  • 2
  • 11
  • 35