Quantcast
Channel: What is the best way to deal with the NSDateFormatter locale "feature"? - Stack Overflow
Browsing all 5 articles
Browse latest View live

Answer by Sunil M. for What is the best way to deal with the NSDateFormatter...

Here is the solution for that problem in the swift version. In swift we can use extension instead of category.So, Here I have created the extension for the DateFormatter and inside that...

View Article



Answer by Daniel for What is the best way to deal with the NSDateFormatter...

May I suggest something totally different because to be honest all of this is somewhat running down a rabbit hole. You should be using one NSDateFormatter with dateFormat set and locale forced to...

View Article

Answer by Hot Licks for What is the best way to deal with the NSDateFormatter...

Duh!!Sometimes you have an "Aha!!" moment, sometimes it's more of a "Duh!!" This is the latter. In the category for initWithSafeLocale the "super" init was coded as self = [super init];. This inits the...

View Article

Answer by omz for What is the best way to deal with the NSDateFormatter...

Instead of subclassing, you could create an NSDateFormatter category with an additional initializer that takes care of assigning the locale and possibly also a format string, so you'd have a...

View Article

What is the best way to deal with the NSDateFormatter locale "feature"?

It seems that NSDateFormatter has a "feature" that bites you unexpectedly: If you do a simple "fixed" format operation such as:NSDateFormatter* fmt = [[NSDateFormatter alloc] init];[fmt...

View Article

Browsing all 5 articles
Browse latest View live




Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>