在基于视图的TableView中重新排序NSTableview行 [英] Reordering of NSTableview Rows in View based Tableview
问题描述
根据苹果文档,拖放 NSTableView
委托方法仅用于基于单元格的TableViews而不是基于View。因此,没有办法使用drag&
As per apple documentation drag and drop NSTableView
delegate methods are called only for cell based TableViews not for View based. So there is no way to do reordering of rows using drag & drop for view based NSTableView
?
推荐答案
我已经创建了一个小型示例项目,其中包含 NSOutlineView
您可以在其中添加和删除项目以及重新排序。这不是一个 NSTableView
,但是实施Drag& Drop协议基本上是一样的。
I have created a small sample project which has an NSOutlineView
where you can add and remove items as well as reorder them. This is not an NSTableView
but the implementation of the Drag & Drop protocol is basically identical.
我实现拖放,所以最好看看此提交。
I implemented drag and Drop in one go so it's best to look at this commit.
这篇关于在基于视图的TableView中重新排序NSTableview行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!