How to eliminate core data sqlite warning message when application terminates? How to eliminate core data sqlite warning message when application terminates? sqlite sqlite

How to eliminate core data sqlite warning message when application terminates?


OK, I figured it out. Since my persistent store contained sensitive data, I was encrypting the files on disk as the final step before shutting down. However, the Core Data stack was still referencing them at this point in the close down process.

The solution was to add code to remove the persistent stores before running the code to encrypt the files.

    for store in managedObjectContext!.persistentStoreCoordinator!.persistentStores {        try! managedObjectContext!.persistentStoreCoordinator!.remove(store)    }