Working off the Main Queue
Now that threading with Core Data has been reduced to a binary question, the other type of NSManagedObjectContext we will take a look at is the NSPrivateQueueConcurrencyType.
The singular difference between the two context types is what queue the context is associated with. When you’re working with an NSMainQueueConcurrencyType context, the context automatically associates itself with the main queue. When you initialize an NSPrivateQueueConcurrencyType context, the context will associate itself with a non-main queue that’s private to the context.
Private means that you cannot access that queue directly. Calling dispatch_sync or dispatch_async on that queue is against the API. So, the only way to interact with a private ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access