Instance Method

enumerateEventsMatchingPredicate:usingBlock:

Finds all events that match a given predicate and calls a given callback for each event found.

Declaration

- (void)enumerateEventsMatchingPredicate:(NSPredicate *)predicate usingBlock:(EKEventSearchCallback)block;

Parameters

predicate

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

block

The block callback to call for each event. The callback must match the signature defined by EKEventSearchCallback.

Discussion

Only events that have been committed are included in enumeration. Events saved using saveEvent:span:commit:error: with the commit parameter set to NO must call commit: beforehand to be included.

This method is synchronous. For asynchronous behavior, run the method on another thread with dispatch_async or NSOperation.

See Also