iOS: How to get a proper Month name from a number?

前端 未结 11 845
一向
一向 2020-11-30 22:43

I know that the NSDateformatter suite of functionality is a boon for mankind, but at the same time it is very confusing to me. I hope you can help me out.

Somewhere

11条回答
  •  温柔的废话
    2020-11-30 23:20

    How about:

    NSUInteger i = ;
    NSDateFormatter *df = [NSDateFormatter new];
    // change locale if the standard is not what you want
    NSArray *monthNames = [df standaloneMonthSymbols];
    NSString *monthName = [monthNames objectAtIndex:(i - 1)];
    [df release];
    

提交回复
热议问题