views:

16

answers:

1

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?

+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
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
Ah, yes, you're correct. Updated my answer with another suggestion. :-)
Joshua Nozzi
That works, thanks.
Jason
Glad to help. Remember to accept answers to encourage more help in the future.
Joshua Nozzi