我的iOS应用程序与设备的日历集成在一起。在我的iPad上查看日历应用程序并点击左上方的日历按钮以选择要显示的日历时,我会看到一个名为“日历”的条目。在我的应用程序中,当我按照以下代码遍历可用日历时,“日历”列出了两次。一个是CalDAV的类型,另一个是本地的。我无法在其中一个中创建日历条目,我相信“本地”的一个,不知道为什么。iPad上列出的两个“日历”条目 - 无法使用EventKit写入日历
为什么我看到“日历”列出两次,当我没有看到它在iCal应用程序中列出两次?
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;
}
}
[EKEventStore.calendars的可能重复返回不存在“日历”对象](http://stackoverflow.com/questions/9563981/ekeventstore-calendars-returns-non-existing-calendar-object) – poupou 2012-03-27 01:44:41