Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I am in the process of re-releasing my iPhone app and now an executeFetchRequest on my UIManagedDocument gets an SQLite error code:6922. I have searched the internet and there is no SQLite error code 6922. Anyone seen this. Everything worked fine with Xcode 7.

like image 519
Scott Sarnikowski Avatar asked Sep 11 '16 16:09

Scott Sarnikowski


1 Answers

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.

like image 91
Tagnal Avatar answered Sep 29 '22 01:09

Tagnal