iOS add calendar– Error Domain=EKErrorDomain Code=14 "Calendar has no source"
09:07 04 Feb 2026

error screenshot

An error occurred when adding a calendar in the screenshot above: Error Domain=EKErrorDomain Code=14 "Calendar has no source\"

Code:

EKCalendar *customCalendar = [EKCalendar calendarForEntityType:EKEntityTypeEvent eventStore:eventStore];
        customCalendar.CGColor = UIColor.blueColor.CGColor;
        NSArray *sources = eventStore.sources;
        EKSource *selectedSource;
        BOOL notFind = YES;
        for (EKSource *source in sources) {
            if (source.sourceType == EKSourceTypeLocal || (source.sourceType == EKSourceTypeCalDAV && [source.title.lowercaseString containsString:@"icloud"])) {
                selectedSource = source;
                break;
            }
        }
        if (selectedSource) {
            customCalendar.source = selectedSource;
        }else {
            customCalendar.source = eventStore.defaultCalendarForNewEvents.source;
        }
        NSError *error = nil;
        [eventStore saveCalendar:customCalendar commit:YES error:&error];

User Calendar Source:

[{
        "Subscribed Calendars": [
            {
                "title": "中国大陆节假日",
                "type": 3,
                "immutable": "0",
                "allow": "0"
            },
            {
                "title": "Malaysia Holidays",
                "type": 3,
                "immutable": "0",
                "allow": "0"
            }
        ]
    },
    {
        "Other": [
            {
                "title": "生日",
                "type": 4,
                "immutable": "1",
                "allow": "0"
            }
        ]
    }
]

Why is there no "Local" or "iCloud" calendar source? normal screenshot

ios iphone calendar