NSDateFormatter - set device language as locale?
-
24-10-2019 - |
Question
I'm trying to get the iPhone to display dates formatted by an NSDateFormatter
in the current device language.
I have tried setLocale:[NSLocale currentLocale]
, but that only returns 5
instead of May
(or Mai
, as I want it to be).
EDIT: currentLocale
shows May
(english). systemLocale
shows 5 (I think systemLocale is Norwegian), and autoupdatingCurrentLocale
shows May
as well.
Any help is appreciated. Thanks! :)
NEVERMIND - The simulator played a trick with me, it works on a real device. #
Solution
I had forgotten to set the Region Format to my local region format :)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow