I\'m doing a simple test program using bindings in Swift on OSX. Having an NSTableView, NSArrayController and a model class I try to hook them up together, but without succe
You have to select the Table View Cell
and bind it's value to Table Cell View
with the appropriate objectValue. I don't know how to get rid of the exclamation-mark / warning, but it works.
Are you using NSCell or NSView based tables? How you set up bindings is different for these. What you are doing looks correct for NSCell based tables.
When I set up a NSTableView today, it was a NSView based table, so I had to select the TextField and bind to "Table Cell View" with a Model Key Path "objectValue.name"
See the Table View Programming Guide for Mac: Populating a Table View Using Cocoa Bindings documentation
Beta 5 requires you to explicitly set your properties as dynamic
in order for KVO/bindings to work:
dynamic var firstName = "Brook"
See the Dynamic declaration modifier section of the release notes for more information.
The dynamic keyword enables KVO, proxying, and other advanced Cocoa features to work reliably with Swift declarations.