NSTableView 拖动单元格到 NSView
有人可以在这方面推动我朝正确的方向发展吗?我想将 NSString 从表格单元格拖到 NSView,然后根据该字符串执行某些操作,但拖放操作让我有点头晕。无论如何,知道一个可以解释这一切的直接教程。
谢谢
Could someone nudge me in the right direction on this. I want to drag a NSString from a table cell to a NSView and then do something based on that string but the drag and drop stuff has my head spinning a bit. Anyway know of a straight forward tutorial that can explain all this.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
表视图数据源具有启动拖动操作的方法。这里有一些开始拖动的代码:
对于接收拖动操作,我认为已经有足够的内容了:
这是一个较旧的教程(2002 年),但我认为它应该仍然有效。请务必检查有关已弃用方法/名称的文档(或查看编译器警告): http:// /cocoadevcentral.com/articles/000056.php
Apple 拖放编程指南
或者这个堆栈溢出问题,其中包含示例代码的链接:Cocoa 多窗口拖放示例
The table view data source has a method for starting a drag operation. Here's a little code to start the dragging:
For receiving drag operations, I think there has been enough written about it:
This is an older tutorial (2002), but I think it should still be valid. Just be sure to check the documentation about deprecated methods/names (or look at the compiler warnings): http://cocoadevcentral.com/articles/000056.php
Apples drag and drop programming guide
Or this stack overflow question with links to sample code: Cocoa multi window drag and drop example