How to make journal mode to WAL in IOS 6.0 with UIManagedDocument

120 views Asked by At

I am using UIManagedDocument in my Core Data, and I want to use journal mode to WAL in IOS 6.0... how to do that ?

1

There are 1 answers

0
Tom Harrington On

The journal mode is a persistent store option when you create the UIManagedDocument. You would do something like:

UIManagedDocument *doc = [[UIManagedDocument alloc] initWithFileURL:docURL];
NSDictionary *options = @{ NSSQLitePragmasOption : @{ @"journal_mode": @"DELETE" } };
doc.persistentStoreOptions = options;

Also include whatever other options you use-- NSMigratePersistentStoresAutomaticallyOption, for example.