mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-05-04 20:41:18 +08:00
Added NextiveJSON as a JSON parser.
This commit is contained in:
committed by
Blake Watters
parent
f547439254
commit
f73888e4a3
17
Code/Support/Parsers/JSON/RKJSONParserNXJSON.h
Normal file
17
Code/Support/Parsers/JSON/RKJSONParserNXJSON.h
Normal file
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// RKJSONParserNXJSON.h
|
||||
// RestKit
|
||||
//
|
||||
// Created by Evan Cordell on 7/26/11.
|
||||
// Copyright 2011 Two Toasters. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import "../../RKParser.h"
|
||||
|
||||
@interface RKJSONParserNXJSON : NSObject <RKParser> {
|
||||
|
||||
}
|
||||
|
||||
@end
|
||||
23
Code/Support/Parsers/JSON/RKJSONParserNXJSON.m
Normal file
23
Code/Support/Parsers/JSON/RKJSONParserNXJSON.m
Normal file
@@ -0,0 +1,23 @@
|
||||
//
|
||||
// RKJSONParserNXJSON.m
|
||||
// RestKit
|
||||
//
|
||||
// Created by Evan Cordell on 7/26/11.
|
||||
// Copyright 2011 Two Toasters. All rights reserved.
|
||||
//
|
||||
|
||||
#import "RKJSONParserNXJSON.h"
|
||||
#import "NXJsonParser.h"
|
||||
#import "NXJsonSerializer.h"
|
||||
|
||||
@implementation RKJSONParserNXJSON
|
||||
|
||||
- (NSDictionary*)objectFromString:(NSString*)string error:(NSError**)error {
|
||||
return [NXJsonParser parseString:string error:error ignoreNulls:YES];
|
||||
}
|
||||
|
||||
- (NSString*)stringFromObject:(id)object error:(NSError**)error {
|
||||
return [NXJsonSerializer serialize:object];
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user