iPhone create SQLite database at runtime?

前端 未结 3 2080
独厮守ぢ
独厮守ぢ 2021-01-04 12:59

Most sqlite examples I\'ve found talk about creating a db file from the commandline first and then adding that to your app. For my project, I\'d like to be able to create m

3条回答
  •  佛祖请我去吃肉
    2021-01-04 13:31

    Core Data provides an easy way to manage this - it will look for a database file upon start-up if none exists it will create one for you. It will also create the model for you automatically based on a diagram that you can create in xCode.

    When you come to upgrading people with older databases in the future it will also simplify data migration.

    You access the data with generated Data objects too. Core Data will also use lazy loading for the objects it creates, which is much better than having to manually

    For more information see the Locations demo project and read up on Core Data in the documentation.

提交回复
热议问题