Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to delete all objects for a given entity from the ManagedObjectContext

I don't want to use the reset method for my ManagedObjectContext. I only need to remove all of the objects for a specific entity, but I don't see any methods for doing this. Selecting all of the objects for a specific entity and looping over each and deleting them works, but it's very slow.

like image 452
E-Madd Avatar asked Jun 14 '26 19:06

E-Madd


1 Answers

Selecting all of the objects for a specific entity and looping over each and deleting them works

That's pretty much how you do it.

like image 133
Alex Reynolds Avatar answered Jun 16 '26 09:06

Alex Reynolds



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!