views:

244

answers:

0

In my application, I use a NSTableView in which I allow inline editing. This inline editing is "buffered", which means that the user has to tab through all fields or press return to "commit" the edit. Pressing escape cancels the edit and reverts values.

Up until now, I only needed text fields for inline editing, and I am successfully able to detect when editing ends by using [NSTableView editedColumn] in the textDidEndEditing: notification. If it's -1, it means that editing is over and that I can "commit" the change.

Now, I want to add a column with a NSPopUpButtonCell in my table, and this is where all hell breaks loose, because when the popup cell gets the focus, editedColumn becomes -1, even if editing is not over yet (when I tab out of the popup field, editing continues as usual).

Is there a more reliable way to detect when edition in a NSTableView ends?