使 com.apple.CoreData.ConcurrencyDebug 1 工作 [英] Making com.apple.CoreData.ConcurrencyDebug 1 work

查看:13
本文介绍了使 com.apple.CoreData.ConcurrencyDebug 1 工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试迁移一些代码以使用 NSManagedObjectContextNSPrivateQueueConcurrencyType.

在将上下文保存到其父级,然后保存父级后,我有时会遇到非常奇怪的错误.我想知道这些是否是由于没有正确使用 NSPrivateQueueConcurrencyType 上下文.

我已打开 来自 Ole Begemann

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆