I need to store JSON
parsed data Into propertylist
like below structure using objective C
.
My JSON Response From Server :
{
"response":{
"A":{
"name":"Arun",
"age":"20",
"city":"SFO",
"subject":2
},
"B":{
"name":"Benny",
"age":"20",
"city":"SFO",
"subject":1
},
"C":{
"name":"Nani",
"age":"30",
"city":"SFO",
"subject":0
}
},
"inprogressdata":{
},
"dataspeed":"112 milliseconds..."
}
I am trying like below storage method into propertylist
. Into this propertylist Item 0 , 1, 2
Its called JSON response A, B, C
values Into Array and Item should as a Dictionary.
NOTE :
The A, B, C
values will Increase based on JSON response , I mean Its not static It will go upto Z may be.
Into this Array
values first thing every values should store as a dictionary
. Within that dictionary need to add string values like below and If subject count above 0 based on that count It should create Array of dictionary like below Image.
For example :
-Root
|
|-----Objects [Array Value]
|
|------Item 0(A) [Dictionary Value]
|
|------name (String)
|------age (String)
|------city (String)
|------subject (Number) // If number 2 then need to create "Objects_Subjectcount" [Array Values]
|------Objects_Subjectcount (Array)
|
|------Item 0 [Dictionary Value]
|------Item 1 [Dictionary Value]
Try this code
If my understanding of your question's second part is correct, the code will be like this
The steps are,