|
Hi Everyone, I've been learning how to implement a JSON database that is also local to my project. I'm keeping it local while I build out the rest of my app/project. A part of this app is "accounts", that will often times have multiple "contacts" at each one. The accounts are really crucial here. So say for example it's a chain of stores, that all need to have their own employees. In JSON, I believe this is called nesting. Is that correct? In my project, I've so far been able to get an account view to present just one contact. So how the app works is that you click on an accont from a list, and that next view presents with all of its important data. Some of this data happens to be who works at each of these locations. What I'm struggling with is trying to get more than one person to appear in this 'contacts' area of the app. I will provide a sample below of what I have so far. I think I've done an ok job, and that this has something to do with how I've implemented the contacts field in the list.
That is the rougly the model I'm working with. Below is the view that gets me to the point of presenting "Al Carter". I've tried several thins to get it to also present "Bob Smith".
Any help here or if someone could point me in the correct direction of what I should read up on, would be really helpful. I've been strugglin with this since Wednesday. Anty help is always appreciated! Cheers! |
|
Your There are some other issues in your code.
Take a look at the below code. This is my attempt to illustrate how to achieve what you are trying. It may not match exactly with what you want since you didn't give us sample JSON or a full
|
|
Holy moly! Thank you so much for taking the time to write this out for me. I knew there was a couple of things wrong with my formating/syntax. I'll let you know how it goes - Cheers! |
|
Any chance you can give me one more bit of advice please? As it standsa right now, I've got the view to return the data of contacts, but it's returning all of the contacts from the JSON database. The contacts are meant to be pulled from their specific accounts. I've tried hard to figure this one out, but I'm probably a bit out of my depth here. Any insights or articles I could read that would put me in the right direction? Thank you again! |
SPONSORED Join a FREE crash course for mid/senior iOS devs who want to achieve an expert level of technical and practical skills – it’s the fast track to being a complete senior developer! Hurry up because it'll be available only until April 28th.
Sponsor Hacking with Swift and reach the world's largest Swift community!
This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.