Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I use the same instance of EKEventStore on different threads?

Tags:

ekeventstore

I was wondering if it is safe to use a single instance of EKEventstore on different threads? I can't find anything about it anywhere.

I would be intending to get a unique EKCalendar instance on each thread.

like image 516
Ajaxharg Avatar asked Nov 13 '22 03:11

Ajaxharg


1 Answers

The descriptions of enumerateEventsMatchingPredicate:usingBlock: and eventsMatchingPredicate: in the EKEventStore reference imply that this is safe to do:

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

I'm currently doing this in one of my apps and it appears to be working.

like image 189
Symmetric Avatar answered Jan 04 '23 01:01

Symmetric