You can get the 1-based index of the first weekday of the current locale from the -firstWeekday
method of an NSCalendar
object with the current locale. Then you can modify your week names array accordingly:
// get week day names array
NSArray *weekdays = self.shortWeekdaySymbols;
// adjust array depending on which weekday should be first
NSUInteger firstWeekdayIndex = [NSCalendar currentCalendar].firstWeekday - 1;
if (firstWeekdayIndex) {
NSRange firstRange = NSMakeRange(firstWeekdayIndex, weekdays.count - firstWeekdayIndex);
NSRange lastRange = NSMakeRange(0, firstWeekdayIndex);
NSArray *firstArray = [weekdays subarrayWithRange:firstRange];
NSArray *lastArray = [weekdays subarrayWithRange:lastRange];
weekdays = [firstArray arrayByAddingObjectsFromArray:lastArray];
}
NSLog(@"%@", weekdays);
I don't have the iPhone SDK but AFAIK these APIs should be all available there and behave the same way as on OS X.