I’m using MBS’s eventStore and reminder classes which seem to work well. EventStore includes some pre-defined predicates, but they don’t meet my purpose efficiently.
I’d like to add a new Predicate that just extracts reminders from within a particular calendar and after a particular modifiedDate but can’t see how to do it.
I’ve read through Apple’s Predicate manual but I’m afraid that leaves me in the dark.
When I test something crude like the following
dim v() as variant
dim p as new nsPredicateMBS("calendarIdentifier=%@", v)
I get errors telling me the predicate wasn’t built for the eventStore.
Can anyone provide me with some pointers?
As far as I know the event store only operates on predicates it built.
method predicateForIncompleteRemindersWithDueDate(startDate as date, endDate as date, calendars() as EKCalendarMBS) as NSPredicateMBS
this method may help to get only the incomplete reminders. endDate can be a few years in future.
Thanks Christian - that’s what I feared.
I’m trying to sync reminders with events in my app - so just wanted those that have been modified.
It looks like on an eventStore.changed event I have to download all reminders for particular calendars and then individually identify which have changed by their modified date.
I guess the processing has to happen somewhere, but thought it would be quicker using predicates rather than in Xojo.
you can of course google for tips for Objective C or Swift and maybe I can adapt something.
But yes, you may need to load them all and check modified timestamp.