From 1fdcda9644ba5c580793174cb563a6c53514d456 Mon Sep 17 00:00:00 2001 From: Igotit Date: Fri, 3 May 2013 12:49:11 +0800 Subject: [PATCH] Check whether value is NSNull. When dynamically set property to nil, we must send [NSNull null] instead of nil which can't be set as an NSDictionary value. --- quickdialog/QRootBuilder.m | 2 ++ 1 file changed, 2 insertions(+) diff --git a/quickdialog/QRootBuilder.m b/quickdialog/QRootBuilder.m index c5758cb0..7e070f5b 100644 --- a/quickdialog/QRootBuilder.m +++ b/quickdialog/QRootBuilder.m @@ -58,6 +58,8 @@ + (void)trySetProperty:(NSString *)propertyName onObject:(id)target withValue:(i [target setValue:itemsTranslated forKeyPath:propertyName]; } else if ([value isKindOfClass:[NSDictionary class]]){ [target setValue:value forKeyPath:propertyName]; + } else if (value == [NSNull null]) { + [target setValue:nil forKeyPath:propertyName]; } else if ([value isKindOfClass:[NSObject class]]){ [target setValue:value forKeyPath:propertyName]; } else if (value == nil){