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: http://developer.apple.com/library/mac/#releasenotes/DataManagement/RN-CoreData/_index.html
the following is quoted from apple doc: http://developer.apple.com/library/ios/#releasenotes/General/WhatsNewIniPhoneOS/Articles/iOS5.html
"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. "
Bug fix for issue #76 - mistaken use of NSPrivateQueueConcurrencyType
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.