Hi everyone,

I'm attempting to compare some strings using arbitrary locales. On Leopard this works fine, the NSString method "compare:options:range:locale:" accepts an actual NSLocale instance. However, on Tiger the parameter is typed as NSDictionary. Searching the archives turns up that the dictionary should be generated like so:

NSDictionary* localeDict = [[NSUserDefaults standardUserDefaults] dictionaryRepresentation];

Ignoring the weirdness of that, I'm sure it works great for the current locale, but I need a dictionary for an arbitrary locale, eg:

NSLocale* locale = [[NSLocale alloc] initWithLocaleIdentifier:@"is"]; // Iceland

How do I go about generating one? I tried using:

NSDictionary* localeDict = [NSLocale componentsFromLocaleIdentifier:@"is"];

But it doesn't seem to affect the comparison results. Am I just out of luck on Tiger?

TIA,
~Martin

_______________________________________________

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