获取所选行的值NSTableView [英] get value of selected row NSTableView

查看:106
本文介绍了获取所选行的值NSTableView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何获取NSTableView中所选行的值?

how can i get value of selected row in NSTableView?

推荐答案

Cocoa遵循Model-View-Controller设计模式,所以你的推理以及你自己的设计也应该。

Cocoa follows the Model-View-Controller design pattern, so your reasoning as well as your own designs should as well.

你没有从表中得到任何值,因为你已经在你的模型中。您的控制器(通常是数据源)向表询问其选定的行索引,然后请求您的模型找到与这些索引匹配的对象,然后执行所需的操作。

You don't get any values from the table because you already have them in your model. Your controller (usually the data source) asks the table for its selected row index(es), then asks your model for the objects matching those indexes, then does whatever it needs to do.

这篇关于获取所选行的值NSTableView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆