Example of JSON:
Note: The “Docs” array is one of the many different arrays in this large
array.
{
"Docs": {
"Title1": {
"id": "1",
"active": "0",
"title": "xxx",
"date": "October 22, 2012",
"description": "Description here",
"ext": "DOCX",
"when": "Tuesday, October 23",
"subject": "French",
"author": "xx xD",
"email": "xx.xx@gmail.com",
"day": "Tuesday, October 23",
"dl": "9 downloads"
},
"Title2": {
"id": "2",
"active": "0",
"title": "Vocab, Page 64",
"date": "October 22, 2012",
"description": "Description goes here",
"ext": "XLSX",
"when": "Tuesday October23",
"subject": "French",
"author": "xxxxxx",
"email": "xxx@yahoo.com",
"day": "Tuesday October23",
"dl": "3 downloads"
}
}
How do I make an NSDictionary that gets the title of the “Docs” array (Docs) and also gets the count of the number of arrays in the docs array, for example? Thanks. I am very confused in how to do this.
Something like this:
Once you get the deserialized data, you can iterate through the dictionary to read the elements. To get the count of number of objects: