更改NSDate工作日和月份的语言

Seb*_*Seb 2 objective-c nsdate nsdateformatter nstimezone ios

我想显示这样的日期:工作日7个月.我做了这个,我有正确的语法.

NSDateFormatter* df = [[NSDateFormatter alloc] init];
[df setDateFormat:@"EEEE dd MMMM"];
[df setTimeZone:[NSTimeZone localTimeZone]];
Run Code Online (Sandbox Code Playgroud)

记录的结果是:3月16日星期六.我只想要法国约会,而不是英国约会.我尝试设置本地时区但它什么都没改变.你知道怎么做吗?

tzl*_*tzl 7

使用标识符初始化语言环境.您可以从中获取所有可用的标识符

[NSLocale availableLocaleIdentifiers];
Run Code Online (Sandbox Code Playgroud)

我相信@"fr_BI"是法语标识符之一

NSLocale *locale = [[NSLocale alloc] initWithLocaleIdentifier:@"fr_BI"];
[dateFormatter setLocale:locale];
Run Code Online (Sandbox Code Playgroud)