// Popupcontentviewcontroller is a custom viewcontrler that needs to be popped up for popover. The content shown in the pop-up box is this
Popupcontentviewcontroller * popcontentviewcontrol = [[popupcontentviewcontroller
Alloc] init];
// Setup the popover for use in the Detail View. popovermenu is the previously declared uipopovercontroller object.
// You must use viewcontroller in the pop-up box you created to initialize popover.
Popovermenu = [uipopovercontroller
Alloc] initwithcontentviewcontroller: popcontentviewcontrol];
// Private method of 4.x
[Popovermenu
Setvalue: [nsnumber
Numberwithint: 2]
Forkey: @ "popoverbackgroundstyle"];
// The values are 0-black, 1-white, and 2-white,
// You can also use the following public method to modify the background color of the navigation section in uipopovercontroller.
// [[[Popovermenu contentviewcontroller] view] setbackgroundcolor: [uicolor orangecolor];
// Uipopoverarrowdirectiondown indicates the arrow direction, and down indicates the downward
Popovermenu. popovercontentsize =
Cgsizemake (500,
30 );
[Popovermenu
Presentpoverfromrect: cgrectmake (620, y,
100, 10)
Inview: Self. View
Permittedarrowdirections ctions: uipopoverarrowdirectiondown
Animated: Yes];