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

# show(relativeTo:of:preferredEdge:)

Shows the popover anchored to the specified view.

```
func show(relativeTo positioningRect: NSRect, of positioningView: NSView, preferredEdge: NSRectEdge)
```

## Parameters

`positioningRect`

The rectangle within `positioningView` relative to which the popover should be positioned. Normally set to the bounds of `positioningView`. May be an empty rectangle, which will default to the bounds of `positioningView`.

`positioningView`

The view relative to which the popover should be positioned. Causes the method to raise  <doc://com.apple.documentation/documentation/Foundation/NSExceptionName/invalidArgumentException> if `nil`.

`preferredEdge`

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

## Discussion

This method raises <doc://com.apple.documentation/documentation/Foundation/NSExceptionName/internalInconsistencyException> if [`contentViewController`](/documentation/AppKit/NSPopover/contentViewController) or the view controller’s view is `nil`. If the popover is already being shown, this method updates the anchored view, rectangle, and preferred edge. If the positioning view is not visible, this method does nothing.

---

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)