Home / IOS Development / How do I store data from web to local db? : iOSProgramming

How do I store data from web to local db? : iOSProgramming

Self-taught and working with my own app. I have worked with a cataloging / collection app. I’m right now talking to a web API that will provide the information needed, such as image URLs, product names, release dates, etc. I can see all of this and see specific items from the table view. I’m now to the point where I want the user to be able to select items from the table view for their own collection and keep it persistent and visible and modifiable. I have so many questions and have googled 1000 different things, and have watched countless youtube videos, but I am still a bit lost. I love finding a guide that covers my use case, even if it was a paid tutorial. Here’s what I’m trying to answer.

  • The elements from the server come down via JSON, 20 at a time, and then I have to page for more results. This works, but sorting is a bit limited in terms of what the server will provide. Is there a better way to do this, say with Core Data or Realm to capture all the json data and create a local db from it, and then only periodically update from the server? Or should the data only be retrieved from JSON from the server each time?

  • I realize that in order for users to be able to select items for their own collection, I need a database such as Core Data or Realm, and I think I would like to go with Realm for easy use. I’m not married to this, so convince me otherwise if I’m wrong. My computer models are for analyzing json with decoder. Many of the Realm and Core Data tutorials I come across work with local data, and there is nothing that gets data online. I’m a little lost on what all really should be the way to get the data I receive from the server to something I can store locally for the user to pull up later.

Are there any tutorials, or books, or websites, paid or free that cover this? I do not have a mentor or anyone who can really bounce these questions off, and hope what I ask is not too amateurish. I want to spend time and effort learning this, but I’m just not sure where to look to get an idea of ​​how I can implement this in the way I’m looking for. Basically what I’m looking for is someone to say, learn this, this and that, and give me guidance on where to look to implement what I want to do. I just want to take the items I get on my table display and be able to store them in mine. own collection where I can sort or edit the data and continue. What are the steps and places I should look for to make this happen?

Source link