Save custom value in EKEvent (iPhone Calendar)

My application integrates with the device calendar. When a new item is added to my application, we create a calendar entry for this item. If the item is edited, we need to update the calendar item.

Now I am adding a GUID to EKEvent.Notes, but obviously this is visible to the user, so we add the text “do not delete”. Then we look for a calendar for Notes containing a GUID to find the related item.

Which would be ideal if EKEvent had a Tag property or had some kind of hidden field that could take a string value. Then we could save our unique identifier in this field, and not clutter up the user notes field.

Any suggestions on how to handle this?

Thank.

+5
source share
1 answer

What exactly do you want to do? The eventIdentifier property is used to uniquely identify an EKEvent instance. Using EKEventStore, you can find an existing EKEvent using this identifier. Not surprisingly, this value is read-only.

I can imagine that you want to distinguish between events that were already on the calendar and events created by your application. My solution would be to have a local log of events that you have added to the calendar. For example, you can store this in a local SQLite database. You can refer to events on the iPhone calendar using the values ​​of "eventIdentifier".

+4

All Articles