I have an NSTableView connected to an NSArrayController by setting the column values in interface builder to the appropriate keys in the NSArrayController. I'd like to use a custom sorting order, specifically, compare:options: with NSNumericSearch. Where can I either change my code to do this, or tell interface builder to use a different comparison selector?
views:
16answers:
1
+1
A:
I'm not sure how well this would work with an ArrayController, but you might look into NSTableColumn's -setSortDescriptorPrototype: (passing your columns your own sort descriptor in code).
Joshua Nozzi
2010-09-27 17:19:57
I'd like to keep the behavior where clicking a column header does a sort, I'd just like to change what selector is used for the actual sorting. It sounds like this would just sort the table when I called it once instead of changing which selector is used for comparison. Is that correct?
Jason
2010-09-27 17:46:50
Ah, yes, you're correct. Updated my answer with another suggestion. :-)
Joshua Nozzi
2010-09-27 17:54:31
That works, thanks.
Jason
2010-09-27 18:07:03
Glad to help. Remember to accept answers to encourage more help in the future.
Joshua Nozzi
2010-09-27 18:28:09