On Tue, Jul 20, 2010 at 11:04 AM, Charlie Dickman <3tothe...@comcast.net> wrote:
> You should be able to accomplish what you want using NSPredicate.

NSPredicate will just wind up falling through to the same sorting
methods Roland can call directly.

> You can also use the C functions topper and tolower to detect and distinguish 
> case differences.

Don't do this.

1. These functions are ASCII only. (Although the man page mentions
they extend the standard and support multibyte characters, but that
support could go away.)
2. C wide-character support is not as correct as CFString's. Since you
already have an NSString, it's trivial to use the
CFStringUppercase/CFStringLowercase/CFStringCapitalize API to
correctly change case depending on language:
http://lists.apple.com/archives/cocoa-dev/2009/May/msg00234.html
3. Why convert case when you can compare case- (and
diacritic-)insensitive directly using the CFStringCompareWithOptions
API?

In short, Core Foundation is more correct than your code, unless you
are or plan on hiring a linguistic scholar.

--Kyle Sluder
_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Reply via email to