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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to