diff --git a/PNObject.podspec b/PNObject.podspec index 4b0e70f..2a69b85 100644 --- a/PNObject.podspec +++ b/PNObject.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |s| s.name = "PNObject" -s.version = "0.8.0" +s.version = "0.8.1" s.summary = "PNObject is a simple replica of the more complex ParseObject" # This description is used to generate tags and improve search results. diff --git a/Pod/Classes/PNObject.m b/Pod/Classes/PNObject.m index c12bdfa..ce52a2e 100644 --- a/Pod/Classes/PNObject.m +++ b/Pod/Classes/PNObject.m @@ -348,13 +348,18 @@ NSString * const PNObjectMappingSelector = @"selector"; NSDictionary *JSONMap = [[self class] objcetMapping]; if (self.JSON && [[self.JSON allKeys] count] == 0) { - self.JSON = [self reverseMapping]; + self.JSON = [[NSMutableDictionary alloc] initWithDictionary:[self reverseMapping]]; } for (NSString *key in JSONMap) { if ([self.JSON objectForKey:[JSONMap objectForKey:key]]) { + if ([[self.JSON objectForKey:[JSONMap objectForKey:key]] isKindOfClass:[NSDate class]]) { + [JSONFormObject setObject:[[[self.JSON objectForKey:[JSONMap objectForKey:key]] toGlobalTime] stringWithFormat:kNSDateHelperFormatSQLDateWithTime] forKey:[JSONMap objectForKey:key]]; + } + else { [JSONFormObject setObject:[self.JSON objectForKey:[JSONMap objectForKey:key]] forKey:[JSONMap objectForKey:key]]; + } } } return JSONFormObject;