views:

31

answers:

1

We have a project that 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.

A: 

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

Jim Jeffers
Hit the checkmark next to this answer so the system shows it as answered.
TechZen
No need to be a wiseguy I can't accept my own answer for another 23 hours.
Jim Jeffers