JSON Data

JSON data, especially when it is condensed like it is in your console, may seem daunting. However, it is actually a very simple syntax. JSON can contain the most basic types used to represent model objects: arrays, dictionaries, strings, and numbers. A JSON dictionary contains one or more key-value pairs, where the key is a string and the value can be another dictionary or a string, number, or array. An array can consist of strings, numbers, dictionaries, and other arrays. Thus, a JSON document is a nested set of these types of values.

Here is an example of some really simple JSON:

{
    "name" : "Christian",
    "friends" : ["Stacy", "Mikey"],
    "job" : {
        "company" : "Big Nerd Ranch",
        "title" : "Senior Nerd"
    }
}

This JSON document ...

Get iOS Programming: The Big Nerd Ranch Guide, 6th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.