Monotone-Parent: dc071254a9d11e448e52ad014d8f4d5c92d5e2e0

Monotone-Revision: bdd1da3bc411d49caed330f6c4789f0d801296db

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2010-09-30T17:36:37
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2010-09-30 17:36:37 +00:00
parent b3bc098776
commit 29f1ffe6b2
2 changed files with 19 additions and 5 deletions

View File

@@ -1,3 +1,9 @@
2010-09-30 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* SoObjects/SOGo/NSDictionary+BSJSONAdditions.m
(+[NSMutableDictionary dictionaryWithJSONString:]): return nil
directly if the json string is empty.
2010-09-28 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* SoObjects/SOGo/SOGoUser.m (-_appendSystemMailAccount): cleaned

View File

@@ -191,12 +191,20 @@ const int jsonDoNotIndent = -1;
@implementation NSMutableDictionary (BSJSONAdditions)
+ (NSMutableDictionary *)dictionaryWithJSONString:(NSString *)jsonString
+ (NSMutableDictionary *) dictionaryWithJSONString: (NSString *) jsonString
{
NSScanner *scanner = [[NSScanner alloc] initWithString:jsonString];
NSMutableDictionary *dictionary = nil;
[scanner scanJSONObject:&dictionary];
[scanner release];
NSScanner *scanner;
NSMutableDictionary *dictionary;
dictionary = nil;
if ([jsonString length] > 0)
{
scanner = [[NSScanner alloc] initWithString: jsonString];
[scanner scanJSONObject:&dictionary];
[scanner autorelease];
}
return dictionary;
}