如何从NSDictionary将数据绑定到NSTableView? [英] How to bind data to a NSTableView from a NSDictionary?
本文介绍了如何从NSDictionary将数据绑定到NSTableView?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有人知道如何使用NSDictionary中的绑定值填充NSTableView吗?
Does anybody knows how to fill up a NSTableView using binding values from a NSDictionary?
谢谢.
推荐答案
您需要在Interface Builder中创建一个NSDictionaryController
.将其绑定到您的字典,然后将NSTableView
绑定到NSDictionaryController
中的对象.
You need to create an NSDictionaryController
in Interface Builder. Bind it to your dictionary, and then bind the NSTableView
to the objects in the NSDictionaryController
.
如果您还不完全了解Cocoa绑定和KV编码,则应先从这里开始阅读:
If you don't yet fully understand Cocoa Bindings and KV coding, you should start reading here first: