Bertl
Bertl

Reputation: 625

EKEventStore.calendars returns non-existing "calendar" object

When obtaining all calendars on IOS5 using

EKEventStore *eventStore = [[EKEventStore alloc] init];
NSArray * calendars = [eventStore calendars];

there is a calendar named "calendar" returned. This calendar is not existing in users calendar list. It's holding this properties:

EKCalendar <0x357700> {title = Calendar; type = Local; allowsModify = YES; color = #882F00;

User can store events there. Those events are displayed on the IOS calendar. Does anyone know what kind of calendar this is? Seems to be some sort of default calendar. BTW: Users calendars are all CalDAV based, so this might be the reason for this object.

Upvotes: 3

Views: 1068

Answers (1)

Rok Jarc
Rok Jarc

Reputation: 18875

In code you don't have complete access to all the calendars the user has in its native app.

"Event Kit provides limited access to a user’s calendar information. It is not
suitable for implementing a full-featured calendar application."

If you want to edit an existing event, you'll have no problems:

 "You can fetch events based on a date range or a unique identifier,
receive notifications when event records change, and allow users to create
and edit events for any of their calendars. Changes made to events in a
user’s Calendar database with Event Kit are automatically synced with the
appropriate calendar (CalDAV, Exchange, and so on)."

If you want to add new event, you can only add it to the calendar, that user had selected as the default calendar (in settings application).

    "Creating and Editing Events

    If the event property is nil when you present the view controller,
the user creates a new event in the default calendar and saves it to
the specified event store.

    If the event property is nil when you present the view controller,
the user creates a new event in the default calendar and saves it to
the specified event store."

All quotations from Event Kit Programming Guide.

Upvotes: 1

Related Questions