EventKit 谓词选择
我正在开发的应用程序会将事件写入用户手机上的日历。我正在考虑在我的应用程序事件之前添加像 myapp: 这样的前缀,这样我就可以在事件存储中找到我的事件以显示在表格视图中。
然而,当我查看 ios eventkit 框架。我读得对吗?
我应该只为手机上的应用程序创建一个日历,还是除了日期之外还有其他方法来识别我的事件?
提前致谢。
The app I'm developing will write events to a calendar on the user's phone. I was thinking of preceeding my app's event with a prefix like myapp: so I can find my events in the event store to display in a tableview.
However, it seems that the only predicate available is based upon a start and end date (– predicateForEventsWithStartDate:endDate:calendars:) when I review the ios eventkit framework. Am I reading that right?
Should I just then create a calendar for just my app on the phone or is there another way to identify my events beside dates?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
另一种选择是使用本地存储(sqlite、coredata 等)来索引事件。每个事件都有事件 ID,您可以通过 eventWithIdentifier 从存储中检索事件。
不确定您的数据访问模式是什么,但这也允许您在应用程序中快速存储数据,以便您可以有效地查询(使用强大的谓词和 SQL 语法)。您的本地结果可能只返回 eventId,并在表视图回调中获取该行的 id 并从事件存储中检索。
只是另一种选择...
One other option would be to have local storage (sqlite, coredata etc...) which indexes into the event. Each event has as event id and you can you retrieve the event from the store via eventWithIdentifier.
Not sure what your data access patterns are but that also allows you to quickly store data within your app that you can query effieciently (with a powerful predicates and sql syntax). Your local results could just return eventIds and in the the table view call backs you get the id for that row and retrieve from the events store.
Just another option ...