Created
July 1, 2009 08:43
-
-
Save gabriel/138679 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| NSData *data = [NSData dataWithContentsOfFile:@"example.json"]; | |
| YAJLParser *parser = [[YAJLParser alloc] initWithParserOptions:YAJLParserOptionsAllowComments]; | |
| parser.delegate = self; | |
| [parser parse:data]; | |
| if (parser.parserError) { | |
| NSLog(@"Error:\n%@", parser.parserError); | |
| } | |
| parser.delegate = nil; | |
| [parser release]; | |
| // Include delegate methods from YAJLParserDelegate | |
| /* | |
| - (void)parserDidStartDictionary:(YAJLParser *)parser; | |
| - (void)parserDidEndDictionary:(YAJLParser *)parser; | |
| - (void)parserDidStartArray:(YAJLParser *)parser; | |
| - (void)parserDidEndArray:(YAJLParser *)parser; | |
| - (void)parser:(YAJLParser *)parser didMapKey:(NSString *)key; | |
| - (void)parser:(YAJLParser *)parser didAdd:(id)value; | |
| */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment