Sorting NSTableView
问题 I have two coloumn in NSTableView as Name and Salary with 5-10 values. I want to sort these coloumn after click on header of both the column. There is lots of data present in Internet but I am not able to use these. Please help me to do this in cocoa. Thanks in advance and appreciate any help. 回答1: Each table column has a method setSortDescriptorPrototype Sort descriptors are ways of telling the array how to sort itself (ascending, descending, ignoring case etc.) Iterate over each of the