The app allows to manage a list of Suppliers and a list of Products available from those Suppliers. Data model contains 2 entities: Supplier and Product.
Supplier has a 1-to-many relation to Product, with delete rule set to Cascade (as I don't want to keep records of a supplier's products if it gets put out of business). Product has default relationship settings.
In IB, I have 2 array controllers. One points to the Supplier entity, with Parameters: MOC bound to AppDelegate and MKP=managedObjectContext. The other points to the Product entity, with Parameters: MOC bound to AppDelegate and MKP=managedObjectContext, and with Controller Content: Content Set bound to Suppliers array controller, CK=selection and MKP=name_of_relation.
On the interface I have 2 NSTableViews for Suppliers and Products, and buttons to Add/Remove from the tables. When I select a Supplier, only its specific Products are displayed on the Products table. When I delete a product, the product disappears from the table. It works as intended.
I thought it was working fine, until the day where I was curious to see how CoreData actually manages the data fields and tables inside the SQLite database. So I opened it using the SQLiteManager add-on in Firefox and... horror! I see that the Products are not deleted. The data are still there! Only the reference to the Supplier was deleted and that's why it doesn't appear anymore in the table, leading me to think that it had been correctly deleted.
What did I do wrong? Is it something with the Content Set bindings? Thanks for advice.