Re: iPhone Creating a months view
Re: iPhone Creating a months view
- Subject: Re: iPhone Creating a months view
- From: "Henry McGilton (Boulevardier)" <email@hidden>
- Date: Mon, 4 Jan 2010 13:17:43 -0800
On Jan 4, 2010, at 11:17 AM, Nick Zitzmann wrote:
>
> 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.
As a follow-on to Nick's caveats above, check out NSLocale Calendar Keys
in the NSLocale Class Reference for a list of calendars supported on the phone.
Note that the phone-supported calendars are a subset of those supported on Mac OS X.
And NSCalendarDate appears to have vanished from Mac OS X Foundation as well . . .
Amateur and Professional calendar scholars alike can visit this web site for
everything you never wanted to know about calendar lore:
http://emr.cs.iit.edu/home/reingold/calendar-book/index.shtml
Cheers,
. . . . . . . . Henry
=================================================
iPhone App Development and Developer Education . . .
Visit www.nonatomic-retain.com
Mac OSX Application Development, Plus a Great Deal More . . .
Visit www.trilithon.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