Best way to save data on the iPhone

前端 未结 7 609
一向
一向 2020-11-28 03:59

I am writing an iPhone application, and need to save the state of my application (5K or so).

My main worry is data persisting across upgrades. Some of the applicatio

7条回答
  •  日久生厌
    2020-11-28 04:41

    I use sqlite to store all application data, and preferences. To make sure that updates do not wipe the data, make sure the sqlite file is stored in the Documents directory of the application, which is not overwritten by upgrades. Some of the example code ("SQLite Books" I think) Apple provides has code to handle this.

提交回复
热议问题