有没有人看过这个核心数据异常的来源?可能是什么原因?感谢
核心数据会抛出异常,但会继续而不会出现任何错误
打印例外断点:
(lldb) po *(id *)($esp + 4)
error: Couldn't apply expression side effects : Couldn't dematerialize a result variable: couldn't read its memory
从子托管对象上下文调用save时抛出异常
__block NSError *error;
[backgroundContext performBlockAndWait:^{
[backgroundContext save:&error];
}];
答案 0 :(得分:2)
这是由于违反约束。如果您执行po [$arg1 reason]
,则应获得constraint validation failure
,这意味着您的某个对象的唯一性约束已被违反。如何处理这将取决于您的合并政策。