开发者

EventKit Predicate Choices

开发者 https://www.devze.com 2023-03-31 17:36 出处:网络
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 displ

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 date开发者_C百科s?

Thanks in advance.


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 ...

0

精彩评论

暂无评论...
验证码 换一张
取 消