Skip to content


Subversion checkout URL

You can clone with
Download ZIP


mistakenly use of NSPrivateQueueConcurrencyType #76

simpzan opened this Issue · 1 comment

2 participants


when creating -managedObjectContext of XMPPCoreDataStorage. NSPrivateQueueConcurrencyType type is not correct here. NSPrivateQueueConcurrencyType context can only used with -performBlock...
the old NSConfinementConcurrencyType is appropriate for your code.
check up the doc:

the following is quoted from apple doc:

"When sending messages to a context created with a queue association, you must use the performBlock: or performBlockAndWait: method if your code is not already executing on that queue (for the main queue type) or within the scope of a performBlock... invocation (for the private queue type). Within the blocks passed to those methods, you can use the methods of NSManagedObjectContext freely. "


Thanks for pointing this out to me.

You know, even after reading the documentation I'm still a bit confused. From what I understand (correct me if I'm wrong), the NSPrivateQueueConcurrencyType creates it's own private/internal queue. And we're supposed to then only access the context via performBlock: or performBlockAndWait:. But for some odd reason (IMO), it doesn't bother to enforce this rule?

At any rate, it sounds like you're absolutely correct. NSConfinementConcurrencyType is appropriate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.