mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-04-24 04:46:01 +08:00
Finished split into more logical components. Library now copies Headers to Build/RestKit and you can selectively link against the components your app needs. libRestKit.a contains everything from the core library.
This commit is contained in:
26
Code/Support/Parsers/JSON/RKJSONParser+SBJSON.m
Normal file
26
Code/Support/Parsers/JSON/RKJSONParser+SBJSON.m
Normal file
@@ -0,0 +1,26 @@
|
||||
//
|
||||
// RKJSONParser+SBJSON.m
|
||||
// RestKit
|
||||
//
|
||||
// Created by Blake Watters on 3/4/10.
|
||||
// Copyright 2010 Two Toasters. All rights reserved.
|
||||
//
|
||||
|
||||
#import "RKJSONParser.h"
|
||||
#import "SBJsonParser.h"
|
||||
|
||||
@implementation RKJSONParser
|
||||
|
||||
- (NSDictionary*)objectFromString:(NSString*)string {
|
||||
SBJsonParser* parser = [[SBJsonParser alloc] init];
|
||||
id result = [parser objectWithString:string];
|
||||
[parser release];
|
||||
if (nil == result) {
|
||||
// TODO: Need to surface these errors in a better fashion
|
||||
NSLog(@"[RestKit] RKMappingFormatJSONParser: Parser failed with error trace: %@ and string: %@", [parser errorTrace], string);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@end
|
||||
18
Code/Support/Parsers/JSON/RKJSONParser+YAJL.m
Normal file
18
Code/Support/Parsers/JSON/RKJSONParser+YAJL.m
Normal file
@@ -0,0 +1,18 @@
|
||||
//
|
||||
// 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 {
|
||||
return [string yajl_JSON];
|
||||
}
|
||||
|
||||
@end
|
||||
14
Code/Support/Parsers/RKJSONParser.h
Normal file
14
Code/Support/Parsers/RKJSONParser.h
Normal file
@@ -0,0 +1,14 @@
|
||||
//
|
||||
// RKMappingFormatJSONParser.h
|
||||
// RestKit
|
||||
//
|
||||
// Created by Blake Watters on 3/4/10.
|
||||
// Copyright 2010 Two Toasters. All rights reserved.
|
||||
//
|
||||
|
||||
#import "RKParser.h"
|
||||
|
||||
@interface RKJSONParser : NSObject <RKParser> {
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user