5

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

Thanks in advance.

Omer
  • 5,470
  • 8
  • 39
  • 64

1 Answers1

6

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

iPatel
  • 46,010
  • 16
  • 115
  • 137
Ken Aspeslagh
  • 11,484
  • 2
  • 36
  • 42
  • Hey.. thanks! I'll give it a try... Related to bindings, let's say I understand the concept, but I don't fully get how to apply those in practice =D, maybe the links you provide will help.. bye – Omer Nov 03 '10 at 02:26
  • Sorry, but do you know about any link with some tutorial about NSTableView, and dynamically add columns? I am trying to reach something like the screenshot 5.5 in this link: http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/CocoaFundamentals/CommunicatingWithObjects/CommunicateWithObjects.html – Omer Nov 03 '10 at 12:56
  • That is a window from the iSpend sample code. So look here for that: http://developer.apple.com/library/mac/#samplecode/iSpend/Introduction/Intro.html – Ken Aspeslagh Nov 03 '10 at 13:49