I want to develop an application. The functionality is similar to RSS feed reader. Read a XML from web service and display them in a table view. But I have some problems to deal with the local storage. I do not need to store all the history records since it takes a lot of storage. But I do want to store dozens of newest records so the user can really see something even when the new data is loading or there is no network connection. What should I do? Should I use Coredata or other methods?
Go to Settings > General > [Device] Storage. You might see a list of recommendations for optimizing your device's storage, followed by a list of installed apps and the amount of storage each one uses. Tap an app's name for more information about its storage. Cached data and temporary data might not be counted as usage.
localStorage works on desktop but not mobile (iOS version 12.2)
Local storage is meant for retaining web app data locally using certain frameworks, tools and methods distinctive to different platforms. For iOS storage there are different methods to choose from. The choice, however, depends upon what and how much data you want to store.
There are several ways to implement this storage within your iOS project (3 that I will mention here):
Core Data - Core Data is extremely powerful, and it could certainly handle your use case. There is some overhead in setting up your data model. You can read about Core Data here: https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/CoreData/index.html
SQLite Database - Your core data implementation would probably use SQLite as its persistent store. However, you also can use SQLite directly. This allows you to handle the data however you want, but it also requires a lot of overhead to get it up and running in the manner you mentioned above. This can be a good solution but, I don't think it is a good fit for your project. http://www.techotopia.com/index.php/An_Example_SQLite_based_iOS_4_iPhone_Application
Property List - Property lists are very easy to implement within a project for both reading and writing data. You can read more about property lists here: https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/PropertyLists/Introduction/Introduction.html
Hope that helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With