Network data parsing for iOS development (1) -- Introduction to JSON parsing, and ios -- json

Source: Internet
Author: User

Network data parsing for iOS development (1) -- Introduction to JSON parsing, and ios -- json

Data returned to the client after a server request is generally in JSON or XML format (except for file downloads)

 

This article explains JSON parsing at will.

 

Body:

About JSON:

Supplement:

Note: The key must use double quotation marks. (But it is a single quotation mark in Java)

Conversion table of JSON-OC

Where: null -- return the NSNull type in OC

 

Usage:

There are many JSON resolution solutions, but (Apple's native) NSJSONSerialization has the best performance

Deserialization (JSON --> OC object), the following example is resolved to a dictionary object

Serialization (OC object --> JSON). Note that the dictionary value cannot be passed to nil, but [NSNull null]

Not all types can be converted to JSON.

The following are Apple's official regulations:

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.