0

I am learning iOS database creation using CoreData. I created sample application to understand the CoreData.I extracted the Sqlite file from default database creation directory to check the data using SQLite browser.But DBBrowser showing nothing.But success message showing and data retrieving from the database. Then i found this about CoreData database mode.I found the solution to change the WAL mode.After that i run, again WAL mode database is creating in database directory. I am not understanding what wrong happening with my code. Anyone give the solution.

Xcode version:6.3

iOS sdk:8.3

CODE

  lazy var persistentStoreCoordinator: NSPersistentStoreCoordinator? = {
  var options = Dictionary<NSObject, AnyObject>()
  options[NSMigratePersistentStoresAutomaticallyOption] = true
   options[NSInferMappingModelAutomaticallyOption] = true
   options["journal_mode"] = "DELETE" 

    var coordinator: NSPersistentStoreCoordinator? = NSPersistentStoreCoordinator(managedObjectModel: self.managedObjectModel)
    let url = self.applicationDocumentsDirectory.URLByAppendingPathComponent("CoreDartaDemo.sqlite")
    var error: NSError? = nil
    var failureReason = "There was an error creating or loading the application's saved data."
    if coordinator!.addPersistentStoreWithType(NSSQLiteStoreType, configuration: nil, URL: url, options: options, error: &error) == nil 
     {
      error report
     }
     return coordinator
    }()

1 Answer 1

0

Not sure I fully understand your question, anyway have you tried turning off journaling?

options["journal_mode"] = "OFF"

Hope this helps

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.