Re: Programmatically displaying UISplitViewController popover?
Re: Programmatically displaying UISplitViewController popover?
- Subject: Re: Programmatically displaying UISplitViewController popover?
- From: Evadne Wu <email@hidden>
- Date: Sat, 04 Jun 2011 02:54:46 +0800
So you have the bar button item and tapping it works; I believe tapping it just invokes its action on its target and there is no much wizardry in thaqt. Is the item we’re talking about the same item that the split view controller sends to you in -splitViewController:willHideViewController:withBarButtonItem:forPopoverController: ? If that is the case, does something along the line of [[item target] performSelector:@selector(action) withObject:item] work?
-ev
On Jun 4, 2011, at 02:40, Rick Mann wrote:
>
> On Jun 3, 2011, at 5:42 , Roland King wrote:
>
>> Which bit can't you do? Are you having trouble opening the popover (in which case you just want to call the code which would be called if you pressed the button, just call it programatically) or are you having trouble figuring out when your app is launched in portrait mode, which you could do by setting a flag in one of the application methods to say you just launched, and checking it when you get the viewDidAppear: call.
>
> The former.
>
> I don't call any code when the button is pressed. The UISplitView creates the UIBarButtonItem and handles the action message. This is part of the problem.
>
> I do have a reference to the UIPopoverController, but if I call its -presentPopoverFromBarButtonItem:... method, it pops up with the approximately correct width, and a height of about 10 pixels.
>
> I tried doing this right in -applicationDidFinishLaunching, and I tried doing it after a 1-second delay. Neither worked.
>
> When I tap on the button, it opens correctly.
>
> The next thing I was going to try was to see if the UIBarButtonItem had a UIButton as its view, and try to get the target/selector from that to call, but that's such a disgustingly gross hack, I hope there is a better way.
>
> --
> Rick
>
> _______________________________________________
>
> 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
_______________________________________________
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