Re: Dismissing a Popover Internally
Re: Dismissing a Popover Internally
- Subject: Re: Dismissing a Popover Internally
- From: Gordon Apple <email@hidden>
- Date: Thu, 21 Jul 2011 12:23:51 -0500
- Thread-topic: Dismissing a Popover Internally
After running into difficulties in the second method I proposed, I decided
that the best universal solution was to subclass UIViewController
(POViewController), add an ivar for the popover, and add methods to dismiss
and change height (mainly for dynamically matching table content and for
rotation). Then subclass any root popover viewController from
POViewController. Then I can always get access from
(POViewController*)[self.navigationController.viewControllers
objectAtIndex:0]. Because I have a lot of popovers and only need access in
a few places, I felt this was a better solution than passing the reference
down the line to everyone.
On 7/20/11 2:30 PM, "Matt Neuburg" <email@hidden> wrote:
> On Wed, 20 Jul 2011 12:32:07 -0500, Gordon Apple <email@hidden> said:
>> UIPopoverController has a UINavigationController. Is there any decent way
>> to access the UIPopoverController inside a popover view to dismiss it?
>
> If I understand the question, then basically, no - and it's maddening. On the
> one hand you're told that only one popover should be showing at any one
> moment. On the other hand you don't automatically get a reference to that
> popover. Thus it is up to you to store a reference, manually, to the current
> popover controller at the time it shows its popover, so that you can talk to
> it later in order to dismiss it. Popover controller management can thus get
> really elaborate and clumsy; you're doing all kinds of work that the system
> should just be doing for you.
>
> iOS is funny this way. I'm reminded of how there's no call in iOS 4 that tells
> you current first responder. Obviously the system knows what the first
> responder is, so why won't it tell you? It's kind of dumb. This is similar;
> the system clearly knows useful stuff it won't share with you. m.
>
> --
> matt neuburg, phd = email@hidden, <http://www.apeth.net/matt/>
> A fool + a tool + an autorelease pool = cool!
> Programming iOS 4!
> http://www.apeth.net/matt/default.html#iosbook
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden