Reputation: 28278
I have an NSFetchedResultsController for my Clients, the in turn have Orders. If I delete an Order from a Client the count in my NSFetchedResults controller drops by 1, which seems strange since I am not really deleting the Client but rather an Order associated with it. This of course causes all sorts of problems because now my UITableView is out of sync with what actually exists and I run into all kinds of troubles. Ay idea why this would happen and how to make it stop?
Upvotes: 0
Views: 509
Reputation: 13381
I had a similar confusion where I had my equivalent "Orders" object's delete rule set to 'Cascade' and my "Client" set to 'Nullify', thinking that this meant:
Order, on delete, would nullify its corresponding relationship field in Client, and Client, on delete, would cascade its deletion to all related Orders.
This seems not to be the case. "Orders" should be set to 'Nullify' and "Client" should be set to 'Cascade'.
Example:
Upvotes: 0
Reputation: 3042
In your datamodel verify that the delete action is not set to delete the client when deleting the order.
Upvotes: 1