{
"success":true,
"listings":
{
"50831582253b4acf09000000":
{
"id":"50831582253b4acf09000000",
"title":"fddfds",
"assets":[],
"discussions":[]
}
},
"displaymessage":"1 Listings Found"
}
I am still struggling between dictionaries and arrays. What would make the above an Array?
Thanks
There’s a pretty big difference between dictionaries and arrays. Dictionaries store data entries in relation to a keys you specify on instantiation. For example:
This alloc/inits a dictionary and sets “object1” for “key1” and “object2” for “key2”, so then if you wanted to ask for the value of “key1” you could access it with the following.
Objects in a dictionary can be arrays, dictionaries, booleans, data, dates, numbers and strings.
On the other hand, arrays store data by the datas index within the array:
You can then access the a specific bit of data from within the array by asking for
objectAtIndex:, ex:Which will return “object2” because the first index in an array is always “0”.