更新时间:2022-03-28 21:54:19
一个上下文,如果您对核心数据对象执行并行操作,那么这是错误的。你应该每个线程有一个上下文,并在每次保存时合并上下文。 Apple的核心数据指南更详细地讨论了这一点。
You seem to be using only one context, which is wrong if you have parallel operations executing on your core data objects. You should have a context per thread and merge the contexts every time you save. Apple's Core Data Guideline talks about this in more detail.