I m using NSCache to save data for offline mode in app,but im not getting how to save that cache object in user default so that if app runs again data will be there in cache.I have created NSCache object in a Singleton Class. Any idea or alternate solution will surely be appreciated.
Asked
Active
Viewed 581 times
0
-
2`NSCache` is used to store objects in memory that are expensive to create and may be needed again, but can be recreated if needed; NSCache may evict an item without warning so you must always be prepared for a cache miss; I.e. it may return nil. Given all of this it doesn't make sense to persist an instance of NSCache; you would simply repopulate the cache from the original objects when required – Paulw11 Jul 13 '18 at 10:39
-
I would read through this: https://stackoverflow.com/questions/4542707/save-nscache-contents-to-disk – Andreas is moving to Codidact Jul 13 '18 at 10:51