Hello,

I'm writing an application that handles results for a running club.

I have an NSTableView that has columns bound to a CoreData Entity such as 
Entries.arrangedObjects.position, position is an NSString that contains numbers 
such as @"1" and @"2" or @"" but the position can also be @"DNF" (Did not 
finish).

I have a method in the WindowController that sorts the 'Entry' objects and 
handles these cases correctly returning an NSArray using:

   [array sortUsingComparator:^(id obj1, id obj2)
      {
      NSComparisonResult r;

      r = ....

      return (r);
      }];

How can I get my table view to work so that when the user clicks in the Pos. 
column I can do my custom sort? at present it is doing an ASCII sort so I get 
1, 10, 100, then 2, 20, 200 etc...

I now I need to put a key and sort descriptor in IB but don't know what code I 
have to add to the Entity ot WindowController to handle it.


Thanks, regards, Rob.

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to