Where should I store the SQLite DB for my iPhone app?

前端 未结 3 1183
我寻月下人不归
我寻月下人不归 2021-02-02 13:19

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 custo

3条回答
  •  没有蜡笔的小新
    2021-02-02 13:50

    If your database indeed contains user-generated content, then the Documents directory is its proper location.

    However, you mention that you are persisting "your users settings"... If the data you are persisting are more akin to settings or preferences, then they should reside in the Defaults subsystem. See the documentation for NSUserDefaults.

提交回复
热议问题