iphone - How to verify if an SQLite file is a valid Core Data store, both generally and for specific app? -


I would like to verify my core data store (SQLite file) before loading so that there is no corruption, app bus crashes And will not burn Using the iPhone SDK, there is a way to verify a SQLit file (1) Generally it is not corrupt, and (2) More specifically, whether the SQLite file is possible to store data Does the app match with one of the versions? The second part is important because I have created a backup system that allows users to load back-up SQLite files in the app to replace existing data stores.

TC's answer is perhaps the simplest but you can also see its metadata which will tell both of you That a) has core data metadata and b) What is the hash values ​​for its existence, which you can use to confirm that you have a model that matches those hash values.

You + [NSPersistentStore MetadataForststststorstor with url: error: method.

can access the metadata without loading the store.

Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -