mardi 10 février 2015

CoreData doesn't delete records in autogenerated relationship table

CoreData / SQLite question here...


If you create two entities in XCode, TableA and TableB, and create a many-to-many relationship between them, CoreData will create a 3rd sqlite table at runtime called "Z_TableAToTableB" to manage the relationship between the two.


However, I notice that when I delete ALL rows in TableA and TableB, the records in Z_TableAToTableB remain forever. They are never deleted.


Is this by design? It's really frustrating and causing concurrency issues in my app. I also have cascading delete set up between TableA and TableB, so deleting rows from one will delete rows from the other, but the rows in the 3rd table are never deleted.


How can I delete the records in ZTableAToTableB?


Aucun commentaire:

Enregistrer un commentaire