advertisement

Article:
  Mac OS X's Preferences System (and More!)
Subject:   Sorting?
Date:   2001-09-15 06:08:57
From:   n9yty
Response to: Sorting?


Oh, forgot something...


I figured that once I had the identifier tag for the clicked-column, I could simply call the records sortUsingFunction, with a function that uses caseInsensitiveCompare on the values in the given column, which will be plucked out by the identifier name, passed into the function via the context: parameter.


[records sortUsingFunction:stringSort context:identifier]


and stringSort is basically something like:


NSString *v1 = [val1 objectForKey:context];
NSString *v2 = [val2 objectForKey:context];


return [v1 caseInsensitiveCompare:v2];


Is this really off track?


Thanks again!



1 to 1 of 1
  1. Sorting - Sorting it out...
    2001-09-15 20:21:36  n9yty [View]

    • HELP!!!
      2002-02-08 02:40:53  stupidfish23 [View]

1 to 1 of 1