Instance Method

presentPopoverFromBarButtonItem:permittedArrowDirections:animated:

Displays the popover and anchors it to the specified bar button item.

Declaration

- (void)presentPopoverFromBarButtonItem:(UIBarButtonItem *)item permittedArrowDirections:(UIPopoverArrowDirection)arrowDirections animated:(BOOL)animated;

Parameters

item

The bar button item on which to anchor the popover.

arrowDirections

The arrow directions the popover is permitted to use. You can use this value to force the popover to be positioned on a specific side of the bar button item. However, it is generally better to specify UIPopoverArrowDirectionAny and let the popover decide the best placement. You must not specify UIPopoverArrowDirectionUnknown for this parameter.

animated

Specify YES to animate the presentation of the popover or NO to display it immediately.

Discussion

When presenting the popover, this method adds the toolbar that owns the button to the popover’s list of passthrough views. Thus, taps in the toolbar result in the action methods of the corresponding toolbar items being called. If you want the popover to be dismissed when a different toolbar item is tapped, you must implement that behavior in your action handler methods.

See Also

Presenting and Dismissing the Popover

- presentPopoverFromRect:inView:permittedArrowDirections:animated:

Displays the popover and anchors it to the specified location in the view.

Deprecated
- dismissPopoverAnimated:

Dismisses the popover programmatically.

Deprecated