I have a ViewController
with a 'Note' object as an instance variable. This variable is set before the ViewController
appears.
The Note
object contains a customFields
NSMutableDictionary<String, String>
.
I bind each value of the dictionary to a NSTextField
of the dictionary in viewWillAppear
:
newTextField.bind(.value, to: self, withKeyPath: "note.customFields.\(key)", options: nil)
The textField correctly displays the value from note.customFields.\(key)
.
BUT, if the user edits that value and saves, the change is not reflected in the dictionary.
The save()
(basically a managedobjectcontext.save()) method has been tested with other fields (bound to other non-dictionary instance variables) and works properly.
Is there a reason why the dictionary does not receive the updated value?
Thanks for the help :-)
EDIT: here is the definition of customFields in the model: