A. [] indicates an array
B. {} indicates the relationship between the dictionary and the object model.
C. There are many applications. Basically, the main data transmitted by mobile development is JSON.
D.
To use JSON, obtain data from the network and then use:
[NSJSONSerialization JSONObjectWithData: data options: NSJSONReadingAllowFragments error: nil];
Network data can be deserialized into a dictionary or array. The specific conversion type is shown in the outmost square brackets of JSON.
* XML
A. Big, difficult to parse
B. Difficult parsing steps and low efficiency
C. View XML directly to facilitate data display
XML parsing needs
NSXMLParser * parser = [[NSXMLParser alloc] initWithData: data];
Parser. delegate = self;
[Parser parse];
========================================================== ======================================
/**
-(Void) parserDidStartDocument :( NSXMLParser *) parser
-(Void) parser :( NSXMLParser *) parser didStartElement :( NSString *) elementName namespaceURI :( NSString *) namespaceURI qualifiedName :( NSString *) qName attributes :( NSDictionary *) attributeDict
-(Void) parser :( NSXMLParser *) parser foundCharacters :( NSString *) string
-(Void) parser :( NSXMLParser *) parser didEndElement :( NSString *) elementName namespaceURI :( NSString *) namespaceURI qualifiedName :( NSString *) qName
-(Void) parserDidEndDocument :( NSXMLParser *) parser
-(Void) parser :( NSXMLParser *) parser parseerroccurred :( NSError *) parseError
Clear Saup