What is the difference between [NSLocale preferredLanguages]
and [[NSUserDefaults standardUserDefaults] objectForKey:@\"AppleLanguages\"]
?
Both are meant to return the same thing, the first one is just more convenient.
The Apple Documentation says: for [[NSUserDefaults standardUserDefaults] objectForKey:@"AppleLanguages"]
The returned array contains the languages associated with the AppleLanguages key in the user's preferred order.
The Apple Documentation says: for [NSLocale preferredLanguages]
The user's language preference order as an array of NSString objects,
You should use [NSLocale preferredLanguages]
, use [[NSUserDefaults standardUserDefaults] objectForKey:@"AppleLanguages"]
if you are supporting Mac OS X 10.4 or earlier.