使com.apple.CoreData.ConcurrencyDebug 1工作 [英] Making com.apple.CoreData.ConcurrencyDebug 1 work
问题描述
我正在尝试迁移一些代码,使用带有 NSPrivateQueueConcurrencyType
的 NSManagedObjectContext
。
在将上下文保存到其父级,然后保存父级之后,我有时会遇到非常奇怪的错误。我想知道这些是否是因为没有正确使用 NSPrivateQueueConcurrencyType
上下文。
我已经开启了
I am trying to migrate some code to use an NSManagedObjectContext
with NSPrivateQueueConcurrencyType
.
I'm sometimes getting very odd errors after saving the context to its parent, and then saving the parent. I'm wondering if these are due to be not using the NSPrivateQueueConcurrencyType
context correctly.
I've turned on -com.apple.CoreData.ConcurrencyDebug 1
to try to debug this. I'm pretty sure that this is not working however. If I perform operations on managed object context or change its objects without using performBlock:
, I don't get an error or a throw.
Here's how I've set up the scheme's arguments:. I've also tried it without the leading -
.
Any idea what I'm doing wrong?
The argument -com.apple.CoreData.ConcurrencyDebug
is available from iOS > 8 and OSX > 10.10 : make sure you target the right platform.
The console should log this if the flag is enabled :
CoreData: annotation: Core Data multi-threading assertions enabled.
Source : Core Data Concurrency Debugging from Ole Begemann
这篇关于使com.apple.CoreData.ConcurrencyDebug 1工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!