My setup is an NSTableView with one column that is binded to the NSUserDefaults. Now that works perfectly, as long as nothing gets changed in my tableview.
When I trie to change a value (all simple strings) i get the following error:
Error setting value for key path of object Acid (from bound object <NSTableColumn: 0x1796ef10> identifier: path with object ID 455 in nib named TXPreferencesWindow.nib): [<NSCFString 0x165297e0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key .
Is there a simple way to make that possible? Or should I just implement the Datasource and Delegate methods? (if i did that in the first place, it would have been faster anyway…)
Your error suggests that there is a problem with your binding, since the change is sent to a
NSCFStringobject while it should be sent to a controller.You should tell a bit more about what you’re trying to bind to the table view so we can tell you how you set that up properly.
In one of my projects I’ve bound a
NSArrayofNSMutableDictionarycontaining a editable boolean and string to aNSTableView.I’ve used a
NSArrayController, which has it’s content array bound to an array in theNSUserDefaultsController. TheNSTableView‘s content is then bound to the array controller’sarrangedObjectsand the individual columns’ value toarrangedObjects.dictionaryKey. IIRC it’s import to have “Handles Content as Compound Value” selected in the controller.