I have the code shown below, that pins an NSPopover to my NSTableView. I've looked all over Google, and SO, but I cannot find a way to pin the popover to a specific (selected) cell.
@objc func tableViewDoubleAction(sender: NSTableCellView) {
let message = "Please Choose"
let controller = NSViewController()
controller.view = NSView(frame: CGRect(x: CGFloat(100), y: CGFloat(50), width: CGFloat(300), height: CGFloat(250)))
let popover = NSPopover()
popover.contentViewController = controller
popover.contentSize = controller.view.frame.size
popover.behavior = .transient
popover.animates = true
popover.show(relativeTo: sender.bounds, of: sender as NSView, preferredEdge: NSRectEdge.maxY)
Here's an image to demonstrate the issue:

From the documentation of
NSTableView.doubleAction:From the documentation of
clickedRow:NSTableViewhas a methodrect(ofRow:):Use this rect to position the popover
Put it all together: