Core Data Relationships cause save error after delete

后端 未结 8 1627
粉色の甜心
粉色の甜心 2020-12-29 04:37

This question is probably a long shot. I can\'t figure out the errors I\'m getting on my core data project when I save after I delete an entity.

I have two main enti

8条回答
  •  时光说笑
    2020-12-29 05:23

    I was encountering a very similar issue with cascading deletes, on non optional parent-child relationships. It was very confusing because I thought the parent relationship delete rule was set to cascade. It turns out that the data model editor in Xcode was not saving the delete rule. I would set it to Cascade, go to a different view and come back and it would be set to nullify again. I had to restart Xcode and set the delete rule to cascade. After I did this everything worked.

    So if anyone else encounters this issue double check that Xcode is saving your delete rules before delving into more complicated solutions.

    By the way I'm using core data on iOS with Xcode 5's data model editor.

提交回复
热议问题