mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-05-03 15:04:53 +08:00
Migrate to NSData based parsing/serialization. Slim down RKObjectSerializer and rename to RKObjectParameters. refs #762
This commit is contained in:
@@ -27,19 +27,16 @@
|
||||
#define RKLogComponent lcl_cRestKitSupportParsers
|
||||
|
||||
|
||||
// TODO: JSONKit serializer instance should be reused to enable leverage
|
||||
// TODO: JSONKit serializer instance should be reused to leverage
|
||||
// the internal caching capabilities from the JSONKit serializer
|
||||
@implementation RKJSONParserJSONKit
|
||||
|
||||
- (NSDictionary *)objectFromString:(NSString *)string error:(NSError **)error
|
||||
{
|
||||
RKLogTrace(@"string='%@'", string);
|
||||
return [string objectFromJSONStringWithParseOptions:JKParseOptionStrict error:error];
|
||||
- (id)objectFromData:(NSData *)data error:(NSError **)error {
|
||||
return [data objectFromJSONDataWithParseOptions:JKParseOptionStrict error:error];
|
||||
}
|
||||
|
||||
- (NSString *)stringFromObject:(id)object error:(NSError **)error
|
||||
{
|
||||
return [object JSONStringWithOptions:JKSerializeOptionNone error:error];
|
||||
- (NSData *)dataFromObject:(id)object error:(NSError **)error {
|
||||
return [object JSONDataWithOptions:JKSerializeOptionNone error:error];
|
||||
}
|
||||
|
||||
@end
|
||||
@end
|
||||
Reference in New Issue
Block a user