2. Ninth Division
real legit growing apple platforms development
company in omaha, ne
www.ninthdivision.com
@ninthdivision
Andy Peters
@andypeters
3. Midwest Mobile
Developers
connecting all the mobile developers in the region
(Nebraska, Iowa, Kansas, Missouri)
http://groups.google.com/group/midwest-mobile-developers
47. XML
There is no SOAP Client #642 or XML-RPC Client
#1,203. You parse it yourself.
48. Options for Parsing
XML
• libxml2
• Tree-based: easy to parse, tree in memory
• Event-driven: less memory, more complex managing state
• Text reader: fast, easy to write
• NSXMLParser
• Event-driven: simpler but less powerful than libXML
• No NSXMLDocument on iPhone
• expat too!!!
59. JavaScript Object
Notation
• More lightweight than XML
• Similar to a Property List
• arrays, dictionaries, strings, numbers
• Open Source json-framework wrapper for
Objective-C
• no “official” Apple library (yet)
60. JavaScript Object
Notation
• If I have a choice, I prefer using JSON
• Lightweight
• Fast
• Easy to parse and map to objects.
62. Parsing JSON
#import <JSON/JSON.h>
// Get a JSON string
NSString *jsonString = ....;
// Parsing will result in Foundation objects
id object = [jsonString JSONValue];
63. Using JSON-framework
// Create data.
NSDictionary *dictionary = ...;
// converts into a JSON spring.
jsonString = [dictionary JSONRepresentation];