绑定到 NSSearchField 的 NSTableView - 如何将选择与未过滤的数据源相关联

NSTableView bound to NSSearchField - How to relate selection to unfiltered datasource

我被难住了。我的 Swift 应用程序使用绑定到数组控制器的 NSTableView,并使用绑定的 NSSearchField 作为文本过滤器。我的问题是 table 的 selectionIndexes 绑定为我提供了过滤后 table 中的 selected 索引,而我需要 selected 索引未过滤的 table.

示例...我的 table 有 1000 行,我想 select 第 567 行。我没有向下滚动到第 567 行,而是在搜索框中输入了几个字符,这将行数减少到 17,我感兴趣的行现在是第 12 行。如果我 select 第 12 行,我的应用程序如何确定第 12 行对应于我的数据数组中的第 567 行?

selectionIndexes of NSArrayController 是 arrayController arrangedObjects 中的索引。 arrangedObjects是arrayController的内容,按filterPredicate过滤,按sortDescriptors排序。