简体   繁体   中英

EventKit error getting meetings iOS 11.2.2 on initial load

EventKit showing error when you fetch data for the first time.

[EventKit] Error getting all calendars: Error Domain=EKCADErrorDomain Code=1019 "(null)" 2018-01-17 19:19:22.190518+0530 StickyNoteApp[426:40382] [EventKit] Error getting default calendar for new events: Error Domain=EKCADErrorDomain Code=1019 "(null)" 2018-01-17 19:19:22.190556+0530 StickyNoteApp[426:40382] [EventKit] No object ID provided. Will not find out if the object exists. view will appear

[EventKit] Error (1019) in reply block for CADDatabaseFetchCalendarItemsWithPredicate attempt 1/3 2018-01-17 19:24:54.942170+0530 StickyNoteApp[426:40382] [EventKit] Error (1019) in reply block for CADDatabaseFetchCalendarItemsWithPredicate attempt 2/3 2018-01-17 19:24:54.942572+0530 StickyNoteApp[426:40382] [EventKit] Error (1019) in reply block for CADDatabaseFetchCalendarItemsWithPredicate attempt 3/3 2018-01-17 19:24:54.942588+0530 StickyNoteApp[426:40382] [EventKit] All retries exhausted for CADDatabaseFetchCalendarItemsWithPredicate 2018-01-17 19:19:22.242094+0530

It's bug may be! Anyways, I've got it solved. Need to create new instance of EventStore after granting access as:

    self.eventStore = EKEventStore()
    eventStore.requestAccess(to: .event) { (granted, error) in
        self.eventStore = EKEventStore()//<---------here's trick
        //do stuff
    }

Thanks to this answer !

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM