views:

258

answers:

1

Hello. There are a few different 3rd party code frameworks that include calendar controls, but most of them have a lot of functionality I don't need, plus most of them lack sufficient documentation on how to use them and I'm not a proficient enough iPhone developer to figure it out using just the code. So I'm going to attempt to build my own and I was hoping you could provide me with some high-level direction to get started. At a high level, how could I build a simple, calendar control that doesn't do much more than display a calendar (month view, with the current date highlighted) and allows the user to selected a date?

Something that looks like the calendar in the upper right corner of this image...

alt text

Thanks so much in advance for your help!

+1  A: 

I just got done building a calendar picker class for a client and it was a serious pain in the petoot. You're going to need to get extremely familiar with several classes:

Nscalendar Nsdate Nscalendarcomponents

Apple does have pretty good documentation on all these, but you'll end up hacking away eventually especially when you get to things like daylight savings time, etc. The biggest gotcha that I had to deal with is that nsdate is both a container for time and a date. So you have to normalize or "abstract" away the time to work with date comparisons. One thing to look out for is if construct nsdates without times they default to midnight which isn't really midnight on daylight savings dates.

Goodluck!

nickthedude