Jorge
Jorge

Reputation: 2196

Programmatically show root controller popup in portrait view

Is there any way to programatically show the root view controller in portrait mode responding to a user action?

in my app the root view controller can be updated responding to some user interaction with the detail controller and i'd like to pop it over when that happens.

Thanks!

Upvotes: 4

Views: 849

Answers (1)

puran
puran

Reputation: 11

If you want to pop up the root view control, then use UIPopOverController:

self.QuickSearchPopView = [[[QuickSearchPopView alloc]
    initWithNibName:@"QuickSearchPopView" 
    bundle:[NSBundle mainBundle]] autorelease];

//create a popover controller
self.popoverController = [[[UIPopoverController alloc]
    initWithContentViewController:self.QuickSearchPopView] autorelease];

//present the popover view non-modal with a
//refrence to the button pressed within the current view
[self.popoverController presentPopoverFromRect:self.view.frame
    inView:self.view
    permittedArrowDirections:UIPopoverArrowDirectionAny
    animated:YES];

Upvotes: 1

Related Questions