Instance Method


Presents another view controller as a popover.


- (void)presentViewController:(NSViewController *)viewController asPopoverRelativeToRect:(NSRect)positioningRect ofView:(NSView *)positioningView preferredEdge:(NSRectEdge)preferredEdge behavior:(NSPopoverBehavior)behavior;



The other view controller to present as a popover.


The content size of the popover.


The view relative to which the popover should be positioned. Must not be nil, or else the view controller raises an NSInvalidArgumentException exception.


The edge of positioningView that the popover should prefer to be anchored to.


The popover’s closing behavior. See the NSPopoverBehavior enumeration.


This method calls the presentViewController:animator: method on self (the presenting view controller), and passes a popover animator to that method.

The presented view controller is the delegate and the content view controller of the popover. You can use NSPopoverDelegate methods to customize the popover.

To dismiss the popover, call the dismissViewController: method on self (the presenting view controller).

See Also

Presenting Another View Controller’s Content

- presentViewController:animator:

Presents another view controller using a specified, custom animator for presentation and dismissal.

- dismissViewController:

Dismisses a presented view controller, using the same animator that presented it.

- presentViewControllerAsModalWindow:

Presents another view controller as a modal window, also known as an alert.

- presentViewControllerAsSheet:

Presents another view controller as a sheet.