mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-06-19 18:24:12 +08:00
Overhaul RKParser API's for clarity and simplicity:
* Adds support for NSJSONSerialization. closes #476 * Renames RKParser to RKSerialization * Renames RKParserRegistry to RKMIMETypeSerialization * Rework serialization implementations API's to use class methods * Fold together string and regular expression matching for MIME Type registrations * Port serialization implementations to working off of NSData instead of NSString. refs #762 * Migrate JSONKit to being an optional component. See https://github.com/RestKit/RKJSONKitSerialization
This commit is contained in:
23
Code/Support/RKNSJSONSerialization.m
Normal file
23
Code/Support/RKNSJSONSerialization.m
Normal file
@@ -0,0 +1,23 @@
|
||||
//
|
||||
// RKNSJSONSerialization.m
|
||||
// RestKit
|
||||
//
|
||||
// Created by Blake Watters on 8/31/12.
|
||||
// Copyright (c) 2012 RestKit. All rights reserved.
|
||||
//
|
||||
|
||||
#import "RKNSJSONSerialization.h"
|
||||
|
||||
@implementation RKNSJSONSerialization
|
||||
|
||||
+ (id)objectFromData:(NSData *)data error:(NSError **)error
|
||||
{
|
||||
return [NSJSONSerialization JSONObjectWithData:data options:0 error:error];
|
||||
}
|
||||
|
||||
+ (NSData *)dataFromObject:(id)object error:(NSError **)error
|
||||
{
|
||||
return [NSJSONSerialization dataWithJSONObject:object options:0 error:error];
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user