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
    }()
Community
  • 1
  • 1

1 Answers1

0

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

options["journal_mode"] = "OFF"

Hope this helps

Matteo Piombo
  • 6,688
  • 2
  • 25
  • 25