开发者

CoreData: deleteObject faults on relationships when nil

We have a project th开发者_开发百科at has two one to many relationships. We encounter a core data fault when we try to delete the parent object. This ONLY happens if the child relationships are empty. So for example:

A project has many to-dos and messages. If we create a project and add a message and a to-do to it, and subsequently call deleteObject on the managedObjectContext we have no problem. BUT if we create a new project and then try to call deleteObject without ever creating any to-do's or messages we run into a relationship fault.


We resolved this by changing the inverse relationship's delete rule from nullify to no-action. This makes sense since this relationship is optional.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜