I'm in the process of making a Persian Calendar app for Persian users. I was wondering if I have to make a database to store all the days or is there an algorithm to generate the calendar?
thanx
I'm in the process of making a Persian Calendar app for Persian users. I was wondering if I have to make a database to store all the days or is there an algorithm to generate the calendar?
thanx
You would use a database (or some sort of local storage) to store the events on the calendar. You should not need to store days without any events. A quick Google search turned up several sites with explanations of the calendar - it looks like a very straightforward algorithm.
The NSLocale class has a NSPersianCalendar key you can use to generate a Persian calendar with NSCalendar. It says it is supported in 10.6 but doesn't mention iPhone so it might not be available.
In any case, make sure you use a tested algorithm developed by specialist. Calendar calculations are deceptively complex and error prone.