Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS - RestKit and clearing all data?

I am using RestKit for webservice calls, caching, and etags. I implemented my own coredata model and managedObjects

As soon as the user signs out I need to clear all data in the database. I was able to successfully delete the sqlite file and recreate it, but I can't find out a way to clear all RestKit catching and etag data. How can I completely wipe all data stored by RestKit?

like image 903
aryaxt Avatar asked Aug 26 '11 16:08

aryaxt


2 Answers

You want to call [[RKClient sharedClient].requestCache invalidateAll]; to wipe the cache clean. You can view the API docs.

like image 195
Blake Watters Avatar answered Oct 15 '22 21:10

Blake Watters


Use the following method from the RKManagedObjectStore class.

- (void)deletePersistantStoreUsingSeedDatabaseName:(NSString *)seedFile

http://restkit.org/api/0.9/Classes/RKManagedObjectStore.html#//api/name/deletePersistantStoreUsingSeedDatabaseName:

like image 37
Paul Ardeleanu Avatar answered Oct 15 '22 22:10

Paul Ardeleanu