I am trying to create a day/month UIPickerView, no year. The goal being to pick a day/month to list historic events that happened on that day/month.
[NSCalendar currentCalendar]maximumRangeOfUnit:NSCalendarUnitDay]
will obtain the maximum number of days in any month, i.e. 31 in the Gregorian calendar. What I really want is something along the lines of
[calendar maximumRangeOfUnit:NSCalendarUnitDay inUnit:NSCalendarMonth unit:2]
which would return 29 for February in the Gregorian calendar.
From what I can see the only thing close has a forDate: which isn't helpful. A quick hack would be to use that for a date in a range of 8 years (to handle non leap year centuries), but that wouldn't work for other calendar types with varying leap year rules.
Any suggestions on how to achieve this?