Wrapping Up

Threading is an extremely difficult subject. Very few developers get it right, and even those few still manage to make mistakes in this area. Threading is arguably one of the hardest concepts in computer science.

Threading with Core Data used to be extremely difficult to get right. Now with having only main queue and private queue contexts, it has gotten a lot simpler. It boils down to a simple Boolean decision. If you’re working with the UI, you should be using a main queue context. If you aren’t, then you should be using a private queue context.

However, even with this threading model you may encounter a situation when a lot of work needs to be done on the data in a short period of time. For those very rare instances, the Core ...

Get Core Data in Objective-C, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.