Depending on exactly what data you have and what you want to achieve, you can use -localizedStandardCompare:. This sorts just like the Finder would, which typically includes numeric sorting.I would have expected the sort descriptor that you showed, using a comparator block, to work. Are you sure you set it at the right time? How was columnArray populated? Generally, you should find columns by identifier, not index, since tables can reorder columns or have hidden columns.If you can't get that to work for some reason, you can create a category on NSString with a new comparison method. Be sure to put a unique-to-your-project prefix on the method name so it will never collide with an actual method on NSString, now or in the future. Have it just return the result from -compare:options: (or -compare:options:range:locale: with the locale specified, for locale-appropriate sorting), like your comparator block does.
Topic:
UI Frameworks
SubTopic:
AppKit
Tags: