• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: iPhone Creating a months view
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: iPhone Creating a months view
      • From: "Henry McGilton (Boulevardier)" <email@hidden>
    • Re: iPhone Creating a months view
      • From: "Eric E. Dolecki" <email@hidden>
References: 
 >iPhone Creating a months view (From: "Eric E. Dolecki" <email@hidden>)

  • Prev by Date: Re: iPhone Creating a months view
  • Next by Date: Getting children of all subnodes of a selected node in NSTreeController?
  • Previous by thread: Re: iPhone Creating a months view
  • Next by thread: Re: iPhone Creating a months view
  • Index(es):
    • Date
    • Thread