What are the options for saving data in iOS?

前端 未结 3 1515
旧时难觅i
旧时难觅i 2020-11-30 02:20

I\'d like to serialize a bunch of data and save it to a file, then be able to load it (naturally) and play it back with a feature I have written. (Sorry if my terminology i

3条回答
  •  被撕碎了的回忆
    2020-11-30 02:42

    Yes, pretty right direction. You need to implement something, that is called NSCoding protocol on your object to be able to archive & unarchive it into NSData. See the example: Saving files on iOS using NSFileManager

提交回复
热议问题