本文介绍了在基于视图的TableView中重新排序NSTableview行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据苹果文档,拖放

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行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-16 06:09