firecall
firecall

Reputation: 763

EKCalendar doesn't appear in calendar.app

I followed this answer: how do I create a new EKCalendar on iOS device?

But the calendar I create doesn't appear in the iPhones calendar.app? Should it?

Maybe I'm a bit confused? :)

The code is working and I can log the calendar etc...

Upvotes: 3

Views: 1135

Answers (3)

de.
de.

Reputation: 8457

I found another approach wich is much simpler and probably more robust. Simply use the default calendar's source for your new calendar.

EKSource *theSource = [eventStore defaultCalendarForNewEvents].source;

Source : https://stackoverflow.com/a/13991658/921573

Upvotes: 4

Massimo Oliviero
Massimo Oliviero

Reputation: 1044

I found a solution. The problem is that when iCloud calendars switched on, it hides the locally created ones from the calendar app. To bypass this problem the solution is to add a new calendar to iCloud source:

    for (EKSource *source in self.eventStore.sources)
    {
        if (source.sourceType == EKSourceTypeCalDAV && [source.title isEqualToString:@"iCloud"])
        {
            localSource = source;
            break;
        }
    }

    if (localSource == nil)
    {
        for (EKSource *source in self.eventStore.sources)
        {
            if (source.sourceType == EKSourceTypeLocal)
            {
                localSource = source;
                break;
            }
        }
    }

Upvotes: 3

Nik Burns
Nik Burns

Reputation: 3423

I've also been having the same issues recently. It appears that having iCloud calendars switched on hides the locally created ones from the calendar app. I don't have a solution other than to switch off then off iCloud calendars. I'll report back if I find anything else.

Upvotes: 0

Related Questions