How Sorting Works in RaiseMan

Often, a single sort descriptor will not completely sort a list of objects. To see this in action, run RaiseMan and add three employees. Give them all different names. Give one of them a larger raise (20%, say) and leave the other raises alone. You should have a setup like Figure 9.23.

Figure 9.23  Three employees added in RaiseMan

Three employees added in RaiseMan

Click on the column header of the Raise column. This will add a sort descriptor to the table view’s sortDescriptors array. Bindings will keep the array controller’s sortDescriptors in sync, so its arrangedObjects will be rearranged. The order of the rows in the table ...

Get Cocoa Programming for OS X: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.