Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I haven't done JSON parsing myself in an iOS App, but you should be able to use a library like the <a href="https://github.com/stig/json-framework/">json-framework</a>. This library will allow you to easily parse JSON and generate json from dictionaries / arrays (that's really all JSON is composed of).</p> <p>SBJson docs:</p> <blockquote> <p>JSON is mapped to Objective-C types in the following way:</p> <ul> <li>null -> NSNull</li> <li>string -> NSString</li> <li>array -> NSMutableArray</li> <li>object -> NSMutableDictionary</li> <li>true -> NSNumber's -numberWithBool:YES</li> <li>false -> NSNumber's -numberWithBool:NO</li> <li>integer up to 19 digits -> NSNumber's -numberWithLongLong:</li> <li>all other numbers -> NSDecimalNumber</li> </ul> <p>Since Objective-C doesn't have a dedicated class for boolean values, these turns into NSNumber instances. However, since these are initialised with the -initWithBool: method they round-trip back to JSON properly. In other words, they won't silently suddenly become 0 or 1; they'll be represented as 'true' and 'false' again.</p> <p>As an optimisation integers up to 19 digits in length (the max length for signed long long integers) turn into NSNumber instances, while complex ones turn into NSDecimalNumber instances. We can thus avoid any loss of precision as JSON allows ridiculously large numbers.</p> <p>@page objc2json Objective-C to JSON</p> <p>Objective-C types are mapped to JSON types in the following way:</p> <ul> <li>NSNull -> null</li> <li>NSString -> string</li> <li>NSArray -> array</li> <li>NSDictionary -> object</li> <li>NSNumber's -initWithBool:YES -> true</li> <li>NSNumber's -initWithBool:NO -> false</li> <li>NSNumber -> number</li> </ul> <p>@note In JSON the keys of an object must be strings. NSDictionary keys need not be, but attempting to convert an NSDictionary with non-string keys into JSON will throw an exception.</p> <p>NSNumber instances created with the -numberWithBool: method are converted into the JSON boolean "true" and "false" values, and vice versa. Any other NSNumber instances are converted to a JSON number the way you would expect.</p> </blockquote> <p><strong>Tutorials</strong></p> <blockquote> <p>Are there any tutorials? Yes! These are all tutorials provided by third-party people:</p> <p><a href="http://iphonedevelopertips.com/networking/json-framework-for-iphone.html">JSON Framework for iPhone</a> - a Flickr tutorial in three parts by John Muchow. <a href="http://www.mobileorchard.com/tutorial-json-over-http-on-the-iphone/">JSON Over HTTP On The iPhone</a> - by Dan Grigsby. <a href="http://andyj.be.s79833.gridserver.com/blog/?p=52">AS3 to Cocoa touch</a>: JSON by Andy Jacobs.</p> </blockquote> <p>There are other libraries you can check out as well like TouchJSON, JSONKit, Yet Another JSON Library</p>
    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.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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