Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个 NSTableView 我希望第一行被修复。我不希望在单击任何表格列的标题时对第一行进行排序。该行也应该在滚动时固定。
我认为有两种方法可以:向 tableview 中的对象添加属性。例如一个名为“isFirstRow”的布尔值。将此对象设置为您首先想要的行的 YES,并基于此属性添加一个 sortDescriptor。(我认为这是最干净的解决方案)。
或者从 tableArray 中删除该行,构建表并将该行添加回第一个位置。