O'Reilly logo

Cocoa Programming for OS X: The Big Nerd Ranch Guide by Aaron Hillegass, Adam Preble, Nate Chandler

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Sorting in RaiseMan

You are now ready to add sorting to RaiseMan. When you are done, the user will be able to reorder the employees table by clicking on the table column headers. This action translates to setting the criteria by which the rows will be sorted.

When a user clicks on a table column header, the table view responds by changing its sort descriptors. Sort descriptors, represented by the NSSortDescriptor class, describe how to sort an array of objects. Each sort descriptor contains a key which is a KVC key path, whether it should be ascending (as opposed to descending), and a comparison selector, or method used to compare the two keys. Because sorting with NSSortDescriptor relies upon KVC, it can only be used with NSObject ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required