tags:

views:

93

answers:

1

Hi

I have a iPad app with the following code tied to a button's (bMyDocuments) TouchDown event handler:

UIPopoverController uipoc = new UIPopoverController(new Pop2());
uipoc.PopoverContentSize = new SizeF(200f, 300f);
uipoc.PresentFromRect (bMyDocuments.Frame, v, UIPopoverArrowDirection.Up, true);

Pop2 is a blank UIViewController with the default view (white background, no ui elements).

This code produces a popover from the button, and the size is correct. However the app hangs without any errors, and popover won't disappear when clicking outside of it.

How can I initialize UIPopoverController correctly? Sample code?

thanks,

pom

+1  A: 

Hey Pom,

Chances are that the garbage collector is eating up your UIPopoverController. Try declaring your UIPopovercontroller as a class variable instead of inside your TouchDown event and see how that goes.

Cheers,

ChrisNTR

chrisntr