Permalink
Browse files

Replace JSONKit to NSJSONSerialization

  • Loading branch information...
1 parent 2fa8d89 commit 5c21908e2e91e8c2adbaeff5c9f6509ff766bffe @youknowone committed Nov 3, 2012
Showing with 6 additions and 5 deletions.
  1. +0 −1 Podfile
  2. +2 −2 VisualJSON.xcodeproj/project.pbxproj
  3. +4 −2 VisualJSON/VJJsonDocumentDelegate.m
View
@@ -1,5 +1,4 @@
platform :osx
pod 'cdebug'
pod 'FoundationExtension'
-pod 'JSONKit'
pod 'ObjectXML'
@@ -578,7 +578,7 @@
"$(inherited)",
"\"$(SRCROOT)/Pods/build/Debug\"",
);
- MACOSX_DEPLOYMENT_TARGET = 10.6;
+ MACOSX_DEPLOYMENT_TARGET = 10.7;
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
@@ -598,7 +598,7 @@
"$(inherited)",
"\"$(SRCROOT)/Pods/build/Debug\"",
);
- MACOSX_DEPLOYMENT_TARGET = 10.6;
+ MACOSX_DEPLOYMENT_TARGET = 10.7;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
WRAPPER_EXTENSION = app;
@@ -6,7 +6,6 @@
// Copyright (c) 2012 youknowone.org All rights reserved.
//
-#import "JSONKit.h"
#import "JsonElement.h"
#import "VJJsonDocumentDelegate.h"
@@ -32,7 +31,10 @@ - (BOOL)document:(VJDocument *)document dataIsValid:(NSString *)rawData {
}
- (id)document:(VJDocument *)document structuredDataFromRawDataString:(NSString *)rawData {
- return [JsonElement elementWithObject:rawData.objectFromJSONString];
+ NSError *error = nil;
+ id obj = [NSJSONSerialization JSONObjectWithData:[rawData dataUsingUTF8Encoding] options:NSJSONReadingAllowFragments error:&error];
+ // TODO: do something with error
+ return [JsonElement elementWithObject:obj];
}
- (NSString *)document:(VJDocument *)document prettyTextFromData:(id)data {

0 comments on commit 5c21908

Please sign in to comment.