Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Retrieve EKEvent with specific title in EKEventStore

Hello i have saved some EKEvent in a specific calendar on iCloud, i want retrieve some of these EKEvent with a specific title, it's possible? i see that there is this method:

eventsMatchingPredicate

but there is only one predicate:

predicateForEventsWithStartDate:endDate:calendars:

and i want find EKEvent for title, any idea?

like image 856
Piero Avatar asked Feb 17 '26 13:02

Piero


1 Answers

I would suggest that you store the ID of the event and then fetch it by using EKEventStore method - (EKEvent *)eventWithIdentifier:(NSString *)identifier

EDIT: Aha, now I understand your q. Unfortunately the only predicate you can use with EKEventStore is - (NSPredicate *)predicateForEventsWithStartDate:(NSDate *)startDate endDate:(NSDate *)endDate calendars:(NSArray *)calendars

So you have to supply a start date and end date to fetch events between those dates. After you have fetched the events you can filter the events by using NSArray - filteredArrayUsingPredicate: so there you can give it a predicate with the event's title.

like image 58
Peter Warbo Avatar answered Feb 20 '26 01:02

Peter Warbo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!