Persisting Custom Objects

后端 未结 2 1575
时光说笑
时光说笑 2021-01-30 04:45

I have a custom object that simply inherits from NSObject. It has 3 members - two floats and an NSDate.

My app is going to have an array with a number of th

2条回答
  •  余生分开走
    2021-01-30 05:28

    If you're going to want to retrieve a subset of the objects, SQLite is by far your best choice.

    If not, it's a choice between plist format and NSCoding. plist requires you to be able to convert your custom objects into something plist-friendly and then convert the plist back into your objects, but NSCoding is a little harder to wrap your head around and can't be easily edited (or examined) by hand.

提交回复
热议问题