Resolution (with resolution file attached)

Source: Internet
Author: User


Resolution: data is stored by background developers according to the agreed format (hypothetical), and data is retrieved by previous developers according to the format.


The essence of resolution: the process of extracting the data we want according to the agreed format
Popular formats: XML and JSON

XML parsing principles:
Sax parsing: A parsing Mechanism Based on Event Callback, that is, using protocols and proxies. Sax Parsing is a line-by-line parsing. When reading data, the system parses one row and one row, therefore, the memory occupied by the sax Parsing is small and suitable for big data parsing.
Dom parsing: read all the content into the memory at a time, read the content into a tree structure, layer-by-layer parsing, suitable for small data parsing.

First method of Dom Parsing
 
Dom parsing uses gdataxmlnode, an open-source and efficient XML parsing tool provided by Google, which is 10 times faster than nsxmlparser.
 
Usage: (add the gdataxmlnode. H. M file)
1. Small import system dynamic link library libxml2.2.dylib
2. Add/usr/include/libxml2 to header search path in buildsettings.
3. Add-lxml2 to other linker flags in buildsettings.



The parsing method provided by jsonkit is to add a classification method for nsstring and nsdata. The parsing method is added to the classification method, which is second only to the system's efficiency (using the jsonkit. H. M file)
Parse JSON data into nsarray nsdictionary
 
The nsarray nsdictionary method is to convert the OC object into a JSON string.

Resolution (with resolution file attached)

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.