5

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.

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

I've moved it all on to the same thread as I was having issues with the first time an app was run. After permission for using the store was requested maybe about 1% of users wouldn't have the permission propagated to the other thread causing lots of issues in the app.

Your Answer

Draft saved
Draft discarded

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.