Monotone-Parent: bcd29d180f0f481f03088f9e1fcb3066dcfdbcc9

Monotone-Revision: 367e72af9d08f48f2e598a1e344c784b6bc4ffac

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2009-11-26T19:31:07
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2009-11-26 19:31:07 +00:00
parent b0446051d3
commit 09e4c3f2a9
7 changed files with 29 additions and 15 deletions
+13 -9
View File
@@ -35,15 +35,6 @@ const int jsonDoNotIndent = -1;
@implementation NSDictionary (BSJSONAdditions)
+ (NSMutableDictionary *)dictionaryWithJSONString:(NSString *)jsonString
{
NSScanner *scanner = [[NSScanner alloc] initWithString:jsonString];
NSMutableDictionary *dictionary = nil;
[scanner scanJSONObject:&dictionary];
[scanner release];
return dictionary;
}
- (NSString *)jsonStringValue
{
return [self jsonStringValueWithIndentLevel:0];
@@ -197,3 +188,16 @@ const int jsonDoNotIndent = -1;
}
@end
@implementation NSMutableDictionary (BSJSONAdditions)
+ (NSMutableDictionary *)dictionaryWithJSONString:(NSString *)jsonString
{
NSScanner *scanner = [[NSScanner alloc] initWithString:jsonString];
NSMutableDictionary *dictionary = nil;
[scanner scanJSONObject:&dictionary];
[scanner release];
return dictionary;
}
@end