I'm downloading an SQLite db from the web into my iPad app. If I write it to disk setting atomically: YES
I can't immediately use it because even though the file is there, sqlite complains that the tables aren't there. If I use atomically = NO
or I delay the opening of the file a few instants then I don't have this problem.
I guess I could go about it by setting atomically = NO
but then again is there some sort of guarantee that the whole file has been written to disk right after the writeToFile: call? So far my db is not that big but it will eventually, plus I don't know how long to wait for in other devices.
Apple docs say that this method returns YES
if the operation succeedes but obviously that does not take into account the "lag" saving the file.
Any help is greatly appreciated!
EDIT: I see other people are having the same problem.