Two "Calendar" entries listed on iPad - can't write to calendar using EventKit

Posted by Neal on Stack Overflow See other posts from Stack Overflow or by Neal
Published on 2012-03-26T17:52:04Z Indexed on 2012/04/06 17:28 UTC
Read the original article Hit count: 216

Filed under:
|
|
|

My iOS app integrates with the device's calendar. On my iPad when I view the calendar app and tap the Calendars button on the top left to choose which calendars to show I see one entry named "Calendar". In my app when I loop through available calendars per the code below "Calendar" is listed twice. One is CalDAV for the type, the other is Local. I'm unable to create calendar entries in one of them, I believe the "Local" one, not sure why.

Why do I see "Calendar" listed twice when I do NOT see it listed twice in the iCal app?

        public static List<string> Calendars
    {
        get
        {
            var calendars = new List<string>();

            var ekCalendars = EventStore.Calendars;
            if (ekCalendars != null && ekCalendars.Length > 0)
            {
                foreach (EKCalendar cal in ekCalendars)
                {
                    if (cal.AllowsContentModifications)
                        calendars.Add(cal.Title);
                }
                calendars.Sort();
            }
            return calendars;
        }
    }

© Stack Overflow or respective owner

Related posts about ios

Related posts about ios5