Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
作为官方的“DragNDropOutlineView”示例项目,如果我已经选择了一个项目,单击右键菜单,右键单击的项目将被选中并标有蓝色边框,但未调用 selectionDidChange 方法。它是如何实现的?![在此处输入图像描述][1]
自己回答这个问题,我们无法通过编码来实现,相反,我们可以在界面构建器中创建一个菜单,选择表格视图或大纲视图,将“菜单”出口链接到您刚刚创建的菜单。现在,当您右键单击 item 时,它不会调用 selectionDidChange 通知。