iphone - Parsing Json into array -


i have following json file,

    [   {     "var1": {      },     "var2": "exemple 1",     "var3": data,     "var4": data,     "var5": data,     "var6": [       {         "var7": {          },         "var8": 25,         "var9": 0,         "var10": 0       },       {         "var7": {          },         "var8": 12,         "var9": 1,         "var10": 0       },       {         "var7": {          },         "var8": 12,         "var9": 2,         "var10": 0       }     ],     "var11": 300,     "var12": data,     "var13": 1,     "var14": data,     "var15": data,     "var16": 2,     "var17": data,     "var18": data   }, ] 

i want store elements array access them all. should store every variable in array itself, , have 16 arrays? , access them? or there better way store in 1 array?
using following code 1 variable , entities 1 array :

nsstring *strurl = [nsstring stringwithformat:@"myurl"]; nsdata *dataurl = [nsdata datawithcontentsofurl:[nsurl urlwithstring:strurl]];  nsstring *strresult = [[nsstring alloc] initwithdata:dataurl encoding:nsutf8stringencoding];   nsdictionary *json = [strresult jsonvalue]; arraytouse = [json valueforkeypath:@"var2"]; 

using code, have var2 stored in 1 array : arraytouse have : [@"exemple 1", @"exemple 2 "];
there better way store each entity variable in array ?
desire have : arraytouse = [var1,var2,var3,…];


Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -