supermarin / ObjectiveRecord

ActiveRecord-like API for CoreData
MIT License
1.29k stars 194 forks source link

How should I delete a cascade entity? #122

Closed popularizan closed 7 years ago

popularizan commented 7 years ago

How do I delete an entity that is related to another in cascade? Should I make a "delete" & "save" for N times ? One for each entity ? I only delete the cascaded entities when I run the app for the second time

supermarin commented 7 years ago

I'm pretty sure calling -save on a top one would do the job, since it's telling the managed object context to save it's stuff. Given all your objects are in the same context, this should work.