userInfo in EKEventStoreChanged notification

In the EKEventStoreChanged notification, the notification.userInfo property yields data such as “x-apple-eventkit:///Task/p1133”. That is supposed to tell which event or reminder changed in the event store. notification.object gives the event store.

What do I do with this data and what does it mean? I found documentation saying that when the calendar item that changed is an event, then I can retrieve the events and cast them to the NSManagedObject class, then take the objectID and use it to match the data from userInfo, which would also be an objectID. However, when the calendar item that changed is a reminder, I am not able to do that with a reminder. The reminder object won’t cast to an NSManagedObject. I am not able to get help on this in the Apple developer forums or on Stackexchange. If anyone has the answer for me I would really appreciate it.

Hi @brower,

I’m not sure what documentation you have seen however NSManagedObject is a class for representing Core Data entities and is not related to EventKit in any way so there might have been some confusion here.

The best place to start looking is at the EKEventStoreChanged notification documentation. Unfortunately, none of the values in the userInfo dictionary are officially documented so it’s advised that you don’t rely on this data within your app as there is the potential for it to change in a breaking way without warning.

The above documentation does however recommend that you should refetch all of the EKEvent or EKReminder objects that you have previously accessed in the event of receiving this notification as they will now be considered stale.

I hope this info is useful but please let me know if I can help in any other way :thumbsup: :calendar: