Files
RestKit/Code/Support/Parsers/JSON/RKJSONParser+YAJL.m
Jeremy Ellison 322599e14a Updates from development of Go Try It On v2.0:
* Updates YAJL Parser not to raise an exception and crash when it encounters invalid JSON. The other parsers need to be aligned with this behavior and the delegate methods updated. See Pivotal Story: https://www.pivotaltracker.com/story/show/11925617
* Added requestDidCancel: delegate invocation for tracking cancellation of requests.
* Ensure that the request queue timer is cleared during indeterminate deferral of request loads.
2011-04-05 10:02:34 -04:00

28 lines
546 B
Objective-C

//
// RKMappingFormatJSONParser+YAJL.m
// RestKit
//
// Created by Blake Watters on 9/28/10.
// Copyright 2010 Two Toasters. All rights reserved.
//
#import "RKJSONParser.h"
#import "YAJL.h"
@implementation RKJSONParser
- (NSDictionary*)objectFromString:(NSString*)string {
NSError* error = nil;
NSDictionary* json = [string yajl_JSON:&error];
if (error) {
NSLog(@"Encountered error: %@ parsing json strong: %@", error, string);
}
return json;
}
- (NSString*)stringFromObject:(id)object {
return [object yajl_JSONString];
}
@end