Xcode 8 GM -- SQLite error code:6922, 'disk I/O error' Xcode 8 GM -- SQLite error code:6922, 'disk I/O error' sqlite sqlite

Xcode 8 GM -- SQLite error code:6922, 'disk I/O error'


I also ran into this error in iOS 10 after saving a NSManagedObjectContext to a NSPersistentStore that I had set to a specific file. After saving, the file was deleted (after I had encrypted it and save as another file) and the next time I tried to access data from the NSManagedObjectContext via the exectueFetchRequest, it tried to pull the data from NSPersistentStore file that I had deleted. Since the file no longer existed, it gave me the "SQLite error code:6922, 'disk I/O error'"

If, I do not delete the file I had set my NSPersistentStore as, the executeFetchRequest is able to read the data from the file and no SQLite error is thrown.

It seems that in iOS 10, the data does not remain in memory, or it defaults to reading the data from the file.

If I run the original code in the iOS 9.3 simulator (XCode 8 GM), it works as it previously did and no error occurred.