Objective C Data Caching on iOS

前端 未结 6 1644
北海茫月
北海茫月 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

    Have you noticed the NSCache?

    An NSCache object is a mutable collection that stores key-value pairs, similar to an NSDictionary object. The NSCache class provides a programmatic interface to adding and removing objects and setting eviction policies based on the total cost and number of objects in the cache...

提交回复
热议问题