Created
April 5, 2013 11:01
-
-
Save Morse-Code/5318448 to your computer and use it in GitHub Desktop.
Getting a locale to match the user's language preference.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Getting a locale to match the user's language preference | |
*/ | |
// You’d think you could just use: | |
[NSLocale currentLocale]; | |
// But you’d be wrong. Instead, go with: | |
[[NSLocale alloc] initWithLocaleIdentifier:[NSLocale preferredLanguages][0]]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment