Created
April 22, 2014 10:24
-
-
Save sparga/11173275 to your computer and use it in GitHub Desktop.
Formatters Snippets
This file contains 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
+ (NSNumberFormatter *)<#formatterName#> | |
{ | |
NSMutableDictionary *threadDict = [[NSThread currentThread] threadDictionary]; | |
NSNumberFormatter *aFormatter = [threadDict objectForKey:NSStringFromSelector(_cmd)]; | |
if(nil == aFormatter) { | |
aFormatter = [[NSNumberFormatter alloc] init]; | |
NSLocale *parisLocale = [[NSLocale alloc] initWithLocaleIdentifier:@"fr"]; | |
[aFormatter setLocale:parisLocale]; | |
<#formatterConfiguration#> | |
[threadDict setObject:aFormatter forKey:NSStringFromSelector(_cmd)]; | |
} | |
return aFormatter; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment