How to set Locale for NSDateFormatter? I've tried the below code and its not working.
- (NSString *)localizedStringWithFormat:(NSString *)format {
NSDateFormatter *df = [[NSDateFormatter alloc] init];
[df setDateFormat:format];
NSCalendar *cal = [NSCalendar currentCalendar];
NSLocale *locale = [[NSLocale alloc] initWithLocaleIdentifier: @"fr_FR"];
cal.locale = locale;
df.calendar = cal;
return [df stringFromDate:self];
}
Please let me know how to make this work.
Thanks.