mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-04-13 22:45:23 +08:00
38 lines
783 B
Objective-C
38 lines
783 B
Objective-C
//
|
|
// RKMappingFormatJSONParser+SBJSON.m
|
|
// RestKit
|
|
//
|
|
// Created by Blake Watters on 3/4/10.
|
|
// Copyright 2010 Two Toasters. All rights reserved.
|
|
//
|
|
|
|
#import "RKMappingFormatJSONParser.h"
|
|
#import "SBJsonParser.h"
|
|
|
|
@implementation RKMappingFormatJSONParser
|
|
|
|
- (id)init {
|
|
if (self = [super init]) {
|
|
_parser = [[SBJsonParser alloc] init];
|
|
}
|
|
|
|
return self;
|
|
}
|
|
|
|
- (void)dealloc {
|
|
[_parser release];
|
|
[super dealloc];
|
|
}
|
|
|
|
- (NSDictionary*)objectFromString:(NSString*)string {
|
|
id result = [_parser objectWithString:string];
|
|
if (nil == result) {
|
|
// TODO: Need to surface these errors in a better fashion
|
|
NSLog(@"[RestKit] RKMappingFormatJSONParser: Parser failed with error trace: %@ and string: %@", [(SBJsonParser*)_parser errorTrace], string);
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
@end
|