sorting features (was: [Biococoa-dev] Comments on BCAnnotation)

Charles PARNOT charles.parnot at
Thu Feb 24 22:04:41 EST 2005

>>* I don't like the comparison methods names; why not stick to the Cocoa way, which is simply 'compare:' using 'compareName:' and 'compareContents:'. And I am not sure why you would need a ascending and descending method when one can use reverseEnumerator?
>Somehow this is the way I always used to implement rapid sorting for tableviews. Say you have a mutablearray of BCAnnotations displayed in a tableview, you can quickly sort them in ascending or descending order with this method. Haven't used bindings enough to see if that has become obsolete now. Yes, I can change the methods to compareName: and compareContents: no problem.

I went through the documentation and could not find a 'reverseSort' method for arrays, which I find weird. I was sure something like this existed. I am not sure if bindings stick with that. Anyway, then maybe you could keep the reverse sorting and name it 'reverseCompareName:' and 'reverseCompareContents:', inspired by NSString's 'caseInsensitiveCompare:' method.


Help science go fast forward:

Charles Parnot
charles.parnot at

Room  B157 in Beckman Center
279, Campus Drive
Stanford University
Stanford, CA 94305 (USA)

Tel +1 650 725 7754
Fax +1 650 725 8021

More information about the Biococoa-dev mailing list