How to bind data to a NSTableView from a NSDictionary?

笑着哭i 提交于 2019-12-10 13:49:21

问题


Does anybody knows how to fill up a NSTableView using binding values from a NSDictionary?

Thanks in advance.


回答1:


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.

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



来源:https://stackoverflow.com/questions/4081632/how-to-bind-data-to-a-nstableview-from-a-nsdictionary

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!