I have a large core data store that I dont care about encryption. I am worried about the overhead of the automatic encryption so I am trying to disable it.
For applications built for iOS 5.0 or later, persistent stores now store data by default in an encrypted format on disk.
This is the code I am using, its not crashing, but im not 100% sure is doing anything. (I got the constant names from here).
NSDictionary* optionsDictionary = [NSDictionary
dictionaryWithObject:NSFileProtectionNone
forKey:NSFileProtectionKey];
if (![__persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType
configuration:nil
URL:storeURL
options:optionsDictionary
error:&error]) {
-
Is this the right code?
-
How can I tell if has stopped encryption?
According to the docs, that code should turn off all the file protection even on iOS5. You can’t easily test it, however.