如何将数据从 NSDictionary 绑定到 NSTableView?
有谁知道如何使用 NSDictionary 中的绑定值填充 NSTableView ?
提前致谢。
Does anybody knows how to fill up a NSTableView using binding values from a NSDictionary?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要在 Interface Builder 中创建一个
NSDictionaryController
。将其绑定到您的字典,然后将NSTableView
绑定到NSDictionaryController
中的对象。看这里:
http://developer.apple.com/ library/mac/#documentation/Cocoa/Reference/NSDictionaryController_Class/Introduction/Introduction.html
如果您还没有完全理解 Cocoa 绑定和 KV 编码,您应该首先从这里开始阅读:
http://developer.apple. com/library/mac/#documentation/Cocoa/Conceptual/CocoaBindings/CocoaBindings.html%23//apple_ref/doc/uid/10000167i
You need to create an
NSDictionaryController
in Interface Builder. Bind it to your dictionary, and then bind theNSTableView
to the objects in theNSDictionaryController
.Look here:
http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/NSDictionaryController_Class/Introduction/Introduction.html
If you don't yet fully understand Cocoa Bindings and KV coding, you should start reading here first:
http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/CocoaBindings/CocoaBindings.html%23//apple_ref/doc/uid/10000167i