I have some editable cells in an NSTableView
.
I enter a cell by double clicking on it. I have other buttons on the window. Any time I click on a button, this terminates the cell editing in a way I just get nothing in the cell and the NSTableView is not refreshed, even if I call [myTableView reloadData]
.
A possible workaround would be to disable all the buttons as soon as I start a cell edit in the NSTableView
but I do not know how to detect this.
I can capture things as soon as something is typed in with :
(void)controlTextDidBeginEditing:(NSNotification *)notification
But this is not what I want, it's just too late, because it only gets called after the user types into the cell editor.
I want to detect exactly when the cell editing starts, even if nothing has been typed yet.
I have seen some posts with a possible outcome:
It’s best to first ask the window to become firstResponder (thus taking firstReponder away from the focused field), and if that failed, to resort to the crude “endEditingFor:” method on NSWindow.
But this is just greek to me. Any help is much appreciated.
shouldEditTableColumn
), too late (TN) or never get called (editWithFrame
inNSTextFieldCell
subclass). – Thomas Tempelmann