7

I have a question about EKCalendar's calendarIdentifier property. Is this ID unique on a global level, or on a per-source level? E.g. can I safely store the calendarIdentifier in my app to smoothly identify a calendar across all calendars in the event store (no matter what EKSource they're in) or do I also need to save the EKSource's identifier associated with the calendar?

I have a calendar selection feature in my app, and I want to safely store and load the correct calendar (within the correct account) upon app restart.

Thanks in advance.

user944943
  • 113
  • 1
  • 2
  • 9

1 Answers1

1

From my personal experience and from the description of the property in EKCalendar's class reference it is local to the EKEventStore. An EKCalendar has an EKSource as it's property at the same level as the calendarIdentifier string.

craigmarch
  • 534
  • 3
  • 9
  • 2
    I've found calendarIdentifier to be unique to the device, but not between devices. I needed something to use across all devices via iCloud and this didn't work. It seemed to be the same for some sources (Exchange and iCloud), but not for Gmail. So, I'm stuck matching via stored name and source and asking the user when a match can't be found. – Symmetric Dec 16 '12 at 16:54
  • That's interesting, I would have assumed it to be unique to the iCloud account. One other thing you might want to check is the calendar colour as I think this is sync'd between devices. Hardly ideal, but might reduce the false negatives. – craigmarch Dec 17 '12 at 18:48
  • Can any one help in this : http://stackoverflow.com/questions/33931231/how-to-identify-ekevent-uniquely-with-sync-across-the-devices – Mrug Nov 26 '15 at 05:59