NSPopover和NSTableView单元格

5
我正在寻找一种将NSPopover附加到NSTableView单元格的方法。
showRelativeToRect:(NSRect)positioningRect ofView:(NSView *)positioningView preferredEdge:(NSRectEdge)preferredEdge;

我该如何找到单元格的 positioningRectpositioningView ?这两个属性是指定单元格在页面上的位置以及相对于哪个视图进行定位。
1个回答

17
答案:很简单:使用[tableview frameOfCellAtColumn:0 row:[tableview selectedRow]];替代positioningRect,并使用tableview替代positioningView

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接