Re: iPhone Creating a months view
Re: iPhone Creating a months view
- Subject: Re: iPhone Creating a months view
- From: Nick Zitzmann <email@hidden>
- Date: Mon, 4 Jan 2010 12:17:31 -0700
On Jan 4, 2010, at 11:35 AM, Eric E. Dolecki wrote:
> I am creating an iPhone view that has 12 months of views in it starting with
> January.
Don't make assumptions about calendars unless you are absolutely sure you can get away with them, e.g. every calendar currently in use in the world uses seven day weeks. In this case, you shouldn't, because, for example, while it's true that most calendar types have exactly 12 months in a year, the Hebrew calendar has 12 months in a regular year and 13 months in a leap year. You can use NSCalendar to figure out how many months there are in a given year.
> For each subview (month) I need to get the 1st day of the month (which
> calendar day it falls on as an int). For instance Jan 2010 begins on a
> Friday (int of 5 I assume).
Again, use NSCalendar and NSDateComponents. They are available on the iPhone OS; the older NSCalendarDate class is not available on the iPhone OS.
Nick Zitzmann
<http://www.chronosnet.com/>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden