Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 856639
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T08:16:00+00:00 2026-05-15T08:16:00+00:00

I’m quite new to iphone programming and I want to do the following stuff:

  • 0

I’m quite new to iphone programming and I want to do the following stuff:

  1. get data from a JSON REST web server
  2. parse the received data using YAJL
  3. Draw a graph with those data using core-plot

So, 1th item is fine, I use ASIHttpRequest which runs as espected
3rd is almost fine (I still have to learn how to tune core-plot).

The problem I have is regarding 2nd item.
I use YAJL as it seems to be the faster parser, so why not give it a try 🙂

Here is the part of code that gets the data from the server and parse them:

// Get server data
response_data = [request responseData];

// Parse JSON received
self.arrayFromData = [response_data yajl_JSON];
NSLog(@"Array from data: %@", self.arrayFromData);

The parsing works quite well in fact, the NSLog output is something like:

2010-06-14 17:56:35.375 TEST_APP[3733:207] Array from data :

{
data =     (
            {
        val = 1317;
        date = "2010-06-10T15:50:01+02:00";
    },
            {
        val = 1573;
        date = "2010-06-10T16:20:01+02:00";
    },
        ........
    {
        val = 840;
        date = "2010-06-11T14:50:01+02:00";
    },
            {
        val = 1265;
        date = "2010-06-11T15:20:01+02:00";
    }
);
from = "2010-06-10T15:50:01+02:00";
to = "2010-06-11T15:20:01+02:00";    
max = "2590";    
}

According to th yajl-objc explanations http://github.com/gabriel/yajl-objc, the parsing returns a NSArray…
The thing is… I do not know how to get all the values from it as for me it looks more like a NSDictionary than a NSArray…

Could you please help ?

Thanks a lot,
Luc

edit1: it happens that this object is actually a NSCFDictionary (!), I am still not able to get value from it, when I try the objectFromKey method (that should work on a Dictionary, no ?) it fails.

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T08:16:01+00:00Added an answer on May 15, 2026 at 8:16 am

    It’s returning an NSDictionary. NSCFDictionary is a private subclass and is immaterial to this discussion. So it looks like you’d retrieve stuff like:

    NSDictionary * responseDictionary = ...;
    NSArray * dataArray = [responseDictionary objectForKey:@"data"];
    for (NSDictionary * dataPair in dataArray) {
      NSLog(@"val: %@, date: %@", [dataPair objectForKey:@"val"], [dataPair objectForKey:@"date"]);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want use html5's new tag to play a wav file (currently only supported
I want to construct a data frame in an Rcpp function, but when I
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.