I\'m having an issue where I create my EKCalendar and everything looks good but then when I go to list my calendars, it doesn\'t show up. I also go to check my calendar list
I would not recommend the top answer, since it relies on checking for "iCloud" as the name, something which can be changed by the user. If you just want to make sure the calendar gets saved and you don't necessarily care what source it gets, you could do this:
EKCalendar *calendar = [EKCalendar calendarForEntityType:EKEntityTypeEvent eventStore:eventStore];
calendar.title = @"Calendar name";
NSError *calendarError = nil;
for (EKSource *source in eventStore.sources) {
// We know the birthday source is read-only
if (source.sourceType == EKSourceTypeBirthdays) {
continue;
}
calendar.source = source;
[eventStore saveCalendar:calendar commit:YES error:&calendarError];
// If saving succeeded, we break, otherwise we try a new source
if (!calendarError) {
break;
}
}