jdog
jdog

Reputation: 10759

Restkit delete all objects in coredata for a specific object

Using Restkit and I am not seeing how I go about deleting all the objects (e.g. Shoes) from core data?

I used to use the MSMangedObject+EasyFetching, but it hasn't been updated to RestKit .20.

Upvotes: 1

Views: 758

Answers (1)

Wain
Wain

Reputation: 119031

RestKit isn't designed to delete all objects. If you want to do that you should do it manually.

RestKit is designed so that you can ask it to delete any objects matching a fetch request if they weren't returned from the server in the last request. See: RKManagedObjectRequestOperation in the "Fetch Request Blocks and Deleting Orphaned Objects" section.

If you just need to get access to the managed object context so you can manually delete objects you can do:

[[RKManagedObjectStore defaultStore] mainQueueManagedObjectContext];

Upvotes: 1

Related Questions