• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
locale sensitive string comparison on Tiger
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

locale sensitive string comparison on Tiger


  • Subject: locale sensitive string comparison on Tiger
  • From: Martin Wierschin <email@hidden>
  • Date: Thu, 14 May 2009 00:51:23 -0700

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 (email@hidden)

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:
This email sent to email@hidden


  • Prev by Date: Re: Calling undo programatically
  • Next by Date: Best practices for communicating with Java via Cocoa?
  • Previous by thread: Re: Calling undo programatically
  • Next by thread: Best practices for communicating with Java via Cocoa?
  • Index(es):
    • Date
    • Thread