Best way to save data on the iPhone

前端 未结 7 613
一向
一向 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:53

    It really depends on what you're doing and your needs.

    If it's a small amount of data NSUserDefaults is a great way to go. You can also save a dictionary or an array to your apps Documents folder, then load that file back in on launch.

    SQLite is nice, but unless you've got a lot of data that you'll be querying, it's a little over the top for just saving state.

提交回复
热议问题