Note that there are some explanatory texts on larger screens.

plurals
  1. POModifying the SBJson framwork for my app
    primarykey
    data
    text
    <p>I am using the SBJson framework found at github(brilliant stuff) <a href="https://github.com/stig/json-framework/" rel="nofollow">https://github.com/stig/json-framework/</a></p> <p>with example : <a href="http://blog.zachwaugh.com/post/309924609/how-to-use-json-in-cocoaobjective-c" rel="nofollow">http://blog.zachwaugh.com/post/309924609/how-to-use-json-in-cocoaobjective-c</a></p> <p>This twitter example works great now. </p> <p>So I change my url and </p> <pre><code>for (NSDictionary *status in statuses) { // You can retrieve individual values using objectForKey on the status NSDictionary // This will print the tweet and username to the console NSLog(@"%@ - %@", [status objectForKey:@"text"], [[status objectForKey:@"user"] objectForKey:@"screen_name"]); } </code></pre> <p>to </p> <pre><code>for (NSDictionary *status in statuses) { // You can retrieve individual values using objectForKey on the status NSDictionary // This will print the tweet and username to the console NSLog(@"%@ - %@", [status objectForKey:@"text"], [[status objectForKey:@"message"] objectForKey:@"nationalad"]); } </code></pre> <p>so my json on my page has message: and a nationalad: yet I don't get any return or or log print out. These are the only 2 things I have changed. </p> <p>Any Ideas?</p> <p>This is for the edit:</p> <pre><code> SBJsonParser *parser = [[SBJsonParser alloc] init]; // Prepare URL request to download statuses from Twitter NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.mywebpagehere.com"]]; // Perform request and get JSON back as a NSData object NSData *response = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil]; // Get JSON as a NSString from NSData response NSString *json_string = [[NSString alloc] initWithData:response encoding:NSUTF8StringEncoding]; // parse the JSON response into an object // Here we're using NSArray since we're parsing an array of JSON status objects NSArray *statuses = [parser objectWithString:json_string error:nil]; // Each element in statuses is a single status // represented as a NSDictionary for (NSDictionary *status in statuses) { // You can retrieve individual values using objectForKey on the status NSDictionary // This will print the tweet and username to the console //NSLog(@"%@ - %@", [status objectForKey:@"text"], [[status objectForKey:@"message"] objectForKey:@"nationalad"]); // NSLog(@"Message: %@", [status objectForKey:@"message"]); } // NSDictionary *json = [NSString JSONValue]; NSLog(@"Status: %@", statuses); // NSArray *items = [statuses valueForKeyPath:@"data.array"]; //NSLog(@"message : %@", [[items objectAtIndex:1] objectForKey:@"message"]); </code></pre> <p>and the server page:</p> <pre><code>{ 'message': "&lt;p style=\"color:#FFFFFF;font-family:'Century Gothic',futura,'URW Gothic L',Verdana,sans-serif;\"&gt;Welcome!&lt;\/p&gt;&lt;p style=\"color:#FFFFFF;font-family:'Century Gothic',futura,'URW Gothic L',Verdana,sans-serif;\"&gt;Check out today's Dinner and Lunch specials below!&lt;\/p&gt;", 'nationalad': "&lt;img src='http:\/\/www.mywebpage.com\/images\/national\/fullrz_3_4e81fa75ceba5_mywebpage.JPG'&gt;" } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload