From 0c37caed5c78b4e31352d0bf462c973cfa5c944b Mon Sep 17 00:00:00 2001 From: Giuseppe Nucifora Date: Mon, 2 May 2016 10:41:10 +0200 Subject: [PATCH] - Fix setUser method in PNInstallation --- Example/PNObject/PNObjectAppDelegate.m | 2 ++ PNObject.podspec | 2 +- Pod/Classes/PNClasses/PNInstallation.m | 10 +++++----- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Example/PNObject/PNObjectAppDelegate.m b/Example/PNObject/PNObjectAppDelegate.m index a9c7b27..67cbf90 100644 --- a/Example/PNObject/PNObjectAppDelegate.m +++ b/Example/PNObject/PNObjectAppDelegate.m @@ -138,6 +138,8 @@ NSLog(@"%@",[installation JSONFormObject]); + //[installation setUser:nil]; + } - (void) application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings { diff --git a/PNObject.podspec b/PNObject.podspec index c5f6c17..ef7352c 100644 --- a/PNObject.podspec +++ b/PNObject.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |s| s.name = "PNObject" -s.version = "0.7.8" +s.version = "0.7.9" 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/PNClasses/PNInstallation.m b/Pod/Classes/PNClasses/PNInstallation.m index d048db6..802754b 100644 --- a/Pod/Classes/PNClasses/PNInstallation.m +++ b/Pod/Classes/PNClasses/PNInstallation.m @@ -131,16 +131,16 @@ static bool isFirstAccess = YES; } - (void) setUser:(PNUser *)user { - if (!self.user) { - self.user = user; + if (!_user) { + _user = nil; [[NSNotificationCenter defaultCenter] postNotificationName:PNObjectLocalNotificationPNInstallationUserNew object:nil]; } - else if(self.user.objID != user.objID) { - self.user = user; + else if(_user.objID != user.objID) { + _user = user; [[NSNotificationCenter defaultCenter] postNotificationName:PNObjectLocalNotificationPNInstallationUserChange object:nil]; } else if (user == nil){ - self.user = nil; + _user = nil; [[NSNotificationCenter defaultCenter] postNotificationName:PNObjectLocalNotificationPNInstallationUserDelete object:nil]; } }