From 1bf4b9ef1d54405948903ff0e1dab7f81b21f51a Mon Sep 17 00:00:00 2001 From: Giuseppe Nucifora Date: Tue, 3 May 2016 20:56:37 +0200 Subject: [PATCH] -Fix crash --- PNObject.podspec | 2 +- Pod/Classes/PNObject.m | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/PNObject.podspec b/PNObject.podspec index 2a69b85..3e7a37c 100644 --- a/PNObject.podspec +++ b/PNObject.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |s| s.name = "PNObject" -s.version = "0.8.1" +s.version = "0.8.2" 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 1e5eea4..493107e 100644 --- a/Pod/Classes/PNObject.m +++ b/Pod/Classes/PNObject.m @@ -208,9 +208,7 @@ NSString * const PNObjectMappingSelector = @"selector"; NSString *mappedJSONType; NSString *type; - if (self.JSON && [[self.JSON allKeys] count] == 0) { - self.JSON = [[NSMutableDictionary alloc] initWithDictionary:[self reverseMapping]]; - } + NSDictionary *properties = [PNObject propertiesForClass:self.class]; @@ -348,6 +346,10 @@ NSString * const PNObjectMappingSelector = @"selector"; } } + if (self.JSON && [[self.JSON allKeys] count] == 0) { + self.JSON = JSON; + } + return JSON; }