<!--
{
  "availability" : [
    "macOS: 14.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSPopover/show(relativeTo:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSPopover(im)showRelativeToToolbarItem:"
  },
  "title" : "show(relativeTo:)"
}
-->

# show(relativeTo:)

Shows the popover anchored to the specified toolbar item.

```
func show(relativeTo toolbarItem: NSToolbarItem)
```

## Parameters

`toolbarItem`

The toolbar item anchoring the popover.

## Discussion

Use this method to display a popover relative to a toolbar item. When the item is in the overflow menu, the popover presents itself from another appropriate affordance in the window. See [`show(relativeTo:of:preferredEdge:)`](/documentation/AppKit/NSPopover/show(relativeTo:of:preferredEdge:)) for popover behavior.

This method raises an <doc://com.apple.documentation/documentation/Foundation/NSExceptionName/invalidArgumentException> if it can’t locate the toolbar item. This could occur if the item isn’t in a toolbar, or because the toolbar isn’t in the window.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)