2
votes

In my app I work with CoreData and RestKit. If the app goes in to the background Im encrypting the store sqlite file. Now if a new user is logging in I have to totally clear the store so that the user starts with a new Core Data store. Because I have encrypted the sqlite store I can't decrypt it and then do [[[RKObjectManager sharedManager] objectStore] deletePersistentStore], because the decryption key is created with the user password as an attribute. So I just delete locally my "TestStore_Encrypted.sqlite" file. But if the user is logged in, every fetched request still gets the data, but no sqlite file is on the iPad anymore. So I think its still in the cache or something. I tried to reset with:

[[[[RKObjectManager sharedManager] objectStore] primaryManagedObjectContext] reset];

Any idea how to achieve that?

1

1 Answers

3
votes

The correct way of doing that with RestKit 0.20 is RKManagedObjectStore's resetPersistentStores method.