Objective C Data Caching on iOS

前端 未结 6 1640
北海茫月
北海茫月 2021-02-01 21:30

I am pulling data from an API and then building out my data objects with it. I want to cache this data for the future. I have been storing the string from the api in NSUserDef

6条回答
  •  [愿得一人]
    2021-02-01 21:31

    I'd store the computed/parsed data in either a Core Data store, or in NSData flat files in your application's Documents directory. You're correct that storing that in NSUserDefaults and then re parsing feels a little overkill.

提交回复
热议问题