Objective-c从星期一开始,而不是星期日

Vla*_*lov 4 objective-c nsdate dayofweek

我正在为欧洲市场制作应用程序的自定义日历视图.在一个函数中,我应该得到星期几的数字...我这样做,但它返回从星期日开始的星期几的数字.我应该怎么硬编码从星期一开始返回这个号码?谢谢这是我到目前为止:

-(int)getWeekDay:(NSDate*)date_
{
    NSLocale *frLocale = [[NSLocale alloc] initWithLocaleIdentifier:@"fr_FR"];

    NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
    [gregorian setLocale:frLocale];
    NSDateComponents *comps = [gregorian components:NSWeekdayCalendarUnit fromDate:date_];
    int weekday = [comps weekday];

    NSLog(@"Week day is %i", weekday);
    return weekday;

}
Run Code Online (Sandbox Code Playgroud)