json - iPhone: variable type returned by yajl -
I'm quite new to programming and I want to do the following:
- JSON Get data from REST web server
- Parser data obtained using YAJL
- Draw a graph with those data using core-plot.
So, 1 th item, I use Asaiacteepiaryuist that I, who expects the third almost exactly (I still have to learn how the core-Terrain).
I have a problem with the other thing I use YAJL because it looks like a fast parser, so do not try it :)
Here is the part of the code that Receives data from the server and parses them:
// Get server data response_data = [request response data]; // Pars JSON has received itself. SarfotData = [response_data yajl_JSON]; NSLog (@ "Data from Array:% @", self .nightfamadata); Parsing really works very well, NSLog output is something like this:
2010-06-14 17: 56: 35.375 TEST_APP [3733: 207] ] From the array data:
{data = ({val = 1317; date = "2010-06-10 to 15: 50: 01 + 02: 00";}, {val = 1573} ; Date = "2010-06-10 16: 20: 01 + 02: 00";}, ........ {val = 840; date = "2010-06-11T14: 50: 01 + 02: 00 ";}, {Val = 1265; date =" 2010-06-11 15:15: 20: 01 + 02: 00 ";}); From = "2010-06-10T15: 50: 01 + 02: 00"; From = "2010-06-11 15:15: 20: 01 + 02: 00"; Maximum = "25 9 0"; }
th yajl-objc, parsing the explanation is a NSArray ... the thing is ... I did not get to know how it all values me as I for this
thanks a lot, Luke
edit 1: it happens that this object is actually a NSCFDictionary (in!), I still get value from it I am not able to do the object frombe method (which should work on a dictionary) If it tries, it fails.
This is returning a nsDictionary
. NSCFDictionary
is a private subclass and it does not matter to the discussion. It looks like you will retrieve things like stuff:
NSDictionary * responseDictionary = ...; NSArray * DataArray = [responseDictionary objectForKey: @ "Data"]; For (DataDictionary * DataAir in DataAir) {NSLog (@ "Vel:% @, Date:% @", [DataPar ObjectForcae: @ "Vel"], [DataPar ObjectForcae: @ "Date"]); }
Comments
Post a Comment