Best way to save data on the iPhone

前端 未结 7 567
一向
一向 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

    To save state, NSUserDefaults is the way to go. I believe most, if not all, instances of application data being deleted after an upgrade are due to issues on the AppStore. They may be related to data-format changes, but if you use just NSUserDefaults and standard plist-storable objects (NSString, NSDictionary, NSNumber, NSArray, NSNumber, and primitives), you should be safe.

提交回复
热议问题