Hi everyone,
I got some question in my project here.
Let’s say this is my JSON files data, is an array of car’s brand and each of their model,
[
{
“brand”: “AUDI”,
“model”: [“A3”, “A4”, “A5”]
},
{
“brand”: “BMW”,
“model”: [“1 SERIES”,“2 SERIES”,“3 SERIES”]
},
{
“brand”: “MERCEDES BENZ”,
“model”: [“A CLASS”,“B CLASS”,“C CLASS”]
}
]
When I extract this JSON data for the brand in my picker, I do like this
by using the carMake.swift here
carMake[row].brand is to extract my brand right?
This is the outcome of the carMake[row].brand
How do I extract the brand’s model? such as in brand “AUDI” there are model “A3” , “A4” and etc?
Do I need another empty array to store the model array?
I don’t know if my question make any sense.