I have several iOS apps on the market and in all of them I have a small SQLite database file connected to the app to provide the user with my data. Once installed the user customizes this DB by changing certain options.
Until now, all of these apps store the DB in NSDocumentsDirectory
. After submitting my last update, it was rejected for storing data in the wrong location. For the apps rejected I changed the storage location to NSCachesDirectory
. I am now afraid that the cache will get cleared and erase the users customizations. The app would still function, the DB would get recreated, but all changed tables would be reset, thereby upsetting users.
Where should this type of database file be stored? Was I right to put it in the Docs dir? According to Apple, the Docs dir is for "Critical Data" which is either user generated data or data needed for proper operation of the app. I feel that it falls under that category, persisting my users settings is proper operation, but who wants to await an appeal?