我通过直接选择单元格 (NSTextFieldCell
) 并编辑其中的文本来修改 NSTableView
的源数据。
我需要在编辑单元格之前和之后对单元格执行一些操作。 我在编辑之前执行这样的操作:
- (BOOL)tableView:(NSTableView *)aTableView shouldEditTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex
但是在哪里可以进行后期编辑操作呢?
谢谢
最佳答案
- (void)tableView:(NSTableView *)aTableView
setObjectValue:(id)anObject
forTableColumn:(NSTableColumn *)aTableColumn
row:(NSInteger)rowIndex
For your app to edit the content of an NSCell-based table view, you implement the tableView:setObjectValue:forTableColumn:row: data source protocol method. This method is similar to tableView:objectValueForTableColumn:row:, which provides the data for the table view, but instead of requesting that you return a value for the specified row and column, it provides the new value for that row and cell
关于macos - NSTableView单元格编辑: where to perform post-editing operations?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19135043/