Re: Sorting filenames the way the Finder does?
Re: Sorting filenames the way the Finder does?
- Subject: Re: Sorting filenames the way the Finder does?
- From: Aki Inoue <email@hidden>
- Date: Thu, 7 Jun 2007 23:29:57 -0700
James,
Are you saying it's possible to pass the options listed in the tech
note 1159 to compare:options:?
Jim's comment was pretty close.
By specifying NSCaseInsensitiveSearch and NSNumericSearch (and passing
the locale dict), you get pretty close to what you get from the set of
Unicode Utils options listed in the technote. The only missing bit is
kUCCollateWidthInsensitiveMask (it's pretty rare to encounter
situations to need width-insensitive anyway).
Aki
Jim Correia <mailto:email@hidden> wrote (Thursday, June 7,
2007 3:54 PM -0400):
So, you can either do it the way that is outlined in the technote
(taking advantage of the fact that NSString and CFString are toll
free bridged), or you can use the
- (NSComparisonResult)compare:(NSString *)string options:
(unsigned)mask range:(NSRange)compareRange locale:(NSDictionary
*)dict;
which allows you to pass comparison options through.
Could you clarify the statement "pass comparison options through?"
Are you saying it's possible to pass the options listed in the tech
note 1159 to compare:options:? The options documented for
compare:options: are limited to NSCaseInsensitiveSearch,
NSLiteralSearch, and NSNumericSearch. It doesn't appear that these
would match the laundry list of options that tech note 1159 suggests
passing to UCCompareTextDefault().
It would be slightly more convenient, and possibly more efficient,
if I could compare the NSString objects directly. But creating a
catagory of NSString, extracting the Unicode, and comparing using
UCCompareTextDefault() isn't a strain either.
--
James Bucanek
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden