阅读 Apple 的文档,我仍然对EKCalenderItem 的 calendarItemExternalIdentifier和EKEvent 的 eventIdentifier之间的区别以及我们应该使用哪一个来识别不同设备上的日历事件感到困惑。具体来说:
EKCalendarItem calendarItemExternalIdentifier 日历服务器提供的日历项目的外部标识符。(只读)
和
EKEvent eventIdentifier:事件的唯一标识符。(只读)
EKCalendarItem calendarItemExternalIdentifier 是在 iOS6 中添加的,我原以为这将是我需要保存以便稍后调用的标识符,EKEventStore eventWithIdenfier:
因为它声称:
此标识符允许您跨多个设备访问相同的事件或提醒。
但在我自己的测试中,似乎当我创建并保存一个新的 EKEvent 时,我从 EKEvent 对象中获得的 eventIdenifier 是唯一且有用的,而我获得的 calendarItemExternalIdentifier 似乎无法使用EKEventStore eventWithIdenfier:
如果有人有确凿的答案,我很想知道。