mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-04-30 05:35:40 +08:00
Implementation of Object Mapping 2.0 design:
* Removed RestKit from inheritance hierarchy * Mappings are implemented as concrete classes * Mapper is much more flexible & powerful * Much more robust error handling * Serialization is reimplemented as an object mapping operation * Added ability to serialize to JSON natively * Reworked Core Data integration * Simplified the codebase substantially
This commit is contained in:
24
Code/Support/Parsers/JSON/RKJSONParserJSONKit.m
Normal file
24
Code/Support/Parsers/JSON/RKJSONParserJSONKit.m
Normal file
@@ -0,0 +1,24 @@
|
||||
//
|
||||
// RKJSONParserJSONKit.m
|
||||
// RestKit
|
||||
//
|
||||
// Created by Jeff Arena on 3/16/10.
|
||||
// Copyright 2010 Two Toasters. All rights reserved.
|
||||
//
|
||||
|
||||
#import "RKJSONParserJSONKit.h"
|
||||
#import "JSONKit.h"
|
||||
|
||||
// TODO: JSONKit serializer instance should be reused to enable leverage
|
||||
// the internal cacheing capabilities from the JSONKit serializer
|
||||
@implementation RKJSONParserJSONKit
|
||||
|
||||
- (NSDictionary*)objectFromString:(NSString*)string error:(NSError**)error {
|
||||
return [string objectFromJSONStringWithParseOptions:JKParseOptionStrict error:error];
|
||||
}
|
||||
|
||||
- (NSString*)stringFromObject:(id)object error:(NSError**)error {
|
||||
return [object JSONStringWithOptions:JKSerializeOptionNone error:error];
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user