6

re iPhone 'Event Kit':

How can I specify additional search filters (per doco here) for a fetching calendar items, beyond the limited options of just start & end date mentioned in the doco? (e.g. all events occurring on Mondays, or with title matching xxx)

Or is it a given that there are no such capabilities beyond what is available in predicateForEventsWithStartDate:endDate:calendars: , hence you need to bring in all events and then iterate through them yourself?

Greg
  • 34,042
  • 79
  • 253
  • 454

1 Answers1

5

The documentation has a clear answer to your question. See the notes for the eventsMatchingPredicate: method:

predicate The search predicate. Must be created with the predicateForEventsWithStartDate:endDate:calendars: method.

Since that method does not allow you to give any other criteria than the dates and the calendars to search in, those are your options. Everything else must be done by iterating over the search results.

Ole Begemann
  • 135,006
  • 31
  • 278
  • 256
  • @Greg Almost 5 years forward and this is still the case. Even `NSCompoundPredicate` with predicate created by `predicateForEventsWithStartDate:endDate:calendars:` and some custom one combined together with `andPredicateWithSubpredicates` causes an error that predicate is invalid. – Piotr Byzia Aug 13 '15 at 08:50