Correct way to save/serialize custom objects in iOS

后端 未结 4 1934
北海茫月
北海茫月 2020-11-29 18:29

I have a custom object, a UIImageView subclass which has a few gestureRecognizer objects.

If I have a number of these objects stored in a

4条回答
  •  眼角桃花
    2020-11-29 18:53

    This blog post explains how to store an array of custom objects to disk using NSKeyedArchiver and read it back with NSKeyedUnarchiver:

    http://www.cocoabuilder.com/archive/cocoa/240775-saving-nsarray-of-custom-objects.html

    Apple also has a very helpful guide on the matter, the Archives and Serializations Programming Guide.

提交回复
热议问题