I have a custom NSCell
(actually subclassing NSTextFieldCell
), which is used both in a standalone editor, and in an NSTableColumn
(bound to Core Data through NSArrayController
). When the user changes the value, I call -[NSCell setObjectValue:]
to update the value (it's an NSNumber
). This works in the standalone editor, since when it's done I manually update the binding on it.
[self setObjectValue:[NSNumber numberWithInt:newValue]];
That step (updating the bound field) is missing when the cell is in an NSTableView
- the updated value shows up while the user's editing (with mouse tracking), but as soon as that's over, the value snaps back to the persisted value.
The NSTableColumn
is bound to a key of -[NSArrayController arrangedObjects]
. Is there some sort of call to "commitEditing" or "updateBinding" that I'm missing? I couldn't find any useful functions in the docs for NSCell
or NSTableView
.