Permalink
Browse files

Added string based convenience extensions.

  • Loading branch information...
1 parent 805f750 commit 15cdd7086ceab83e77c8b1d3912e42e4bc1cb7c7 @schwa schwa committed Jan 27, 2011
Showing with 9 additions and 3 deletions.
  1. +9 −3 Source/Extensions/NSDictionary_JSONExtensions.m
@@ -34,8 +34,14 @@
@implementation NSDictionary (NSDictionary_JSONExtensions)
+ (id)dictionaryWithJSONData:(NSData *)inData error:(NSError **)outError
-{
-return([[CJSONDeserializer deserializer] deserialize:inData error:outError]);
-}
+ {
+ return([[CJSONDeserializer deserializer] deserialize:inData error:outError]);
+ }
+
++ (id)dictionaryWithJSONString:(NSString *)inJSON error:(NSError **)outError;
+ {
+ NSData *theData = [inJSON dataUsingEncoding:NSUTF8StringEncoding];
+ return([self dictionaryWithJSONData:theData error:outError]);
+ }
@end

0 comments on commit 15cdd70

Please sign in to comment.