defaultCalendarForNewEvents failed

前端 未结 8 2301
北海茫月
北海茫月 2020-11-29 01:25

When I try to call [newEventStore defaultCalendarForNewEvents], it returns an error message says:

[707:907] defaultCalendarForNewEvents failed: Error Domain         


        
8条回答
  •  独厮守ぢ
    2020-11-29 02:22

    I had the same problem, but finally find what was the reason.

    My case was to add my Reminder and Calendar events, but I was using one EKEventStore. In the end I seperate them and problem dissapeared:

    private static let calendarEventStore = EKEventStore()
    private static let remindersEventStore = EKEventStore()
    

    So now I'm using calendarEventStore for all things related to calendar event and remindersEventStore for reminder one.

    ——

    In my opinion it was related to the fact that I requested defaultCalendarForNewEvents and defaultCalendarForNewReminders() in one EKEventStore entity.

    Also this one from EKEventStore docs:

    Events, Reminders, and Calendar objects retrieved from an event store cannot be used with any other event store

提交回复
热议问题