Inherits from NSObject
Declared in CPJSONParser.h
CPJSONParser.m

Overview

The CPJSONParser class is a demonstration of CoreParse.

The parser deals with all JSON except for unicode encoded characters. The reason for not dealing with this corner case is that this parser is simply to demonstrate how to use CoreParse, and the code needed to process unicode characters is non-trivial, and not particularly relevant to the demonstration.

Tasks

  • – parse:

    Parses a JSON string and returns a standard objective-c data structure reflecting it:

Instance Methods

parse:

Parses a JSON string and returns a standard objective-c data structure reflecting it:

- (id<NSObject>)parse:(NSString *)json

Parameters

json

The JSON string to parse.

Discussion

Parses a JSON string and returns a standard objective-c data structure reflecting it:

JSON numbers and booleans are returned as NSNumbers; JSON strings as NSStrings; null as an NSNull object; JSON arrays are returned as NSArrays; finally JSON objects are returned as NSDictionarys.

Declared In

CPJSONParser.h