From 70c37b432e923c4401913a6e101c8fe2c338eaf8 Mon Sep 17 00:00:00 2001 From: Giuseppe Nucifora Date: Thu, 17 Mar 2016 10:01:15 +0100 Subject: [PATCH] no message --- .../xcshareddata/PNObject.xcscmblueprint | 30 +++++++++++++++++++ PNObject.podspec | 2 +- Pod/Classes/PNClasses/PNUser.m | 15 +++++----- 3 files changed, 39 insertions(+), 8 deletions(-) create mode 100644 Example/PNObject.xcworkspace/xcshareddata/PNObject.xcscmblueprint diff --git a/Example/PNObject.xcworkspace/xcshareddata/PNObject.xcscmblueprint b/Example/PNObject.xcworkspace/xcshareddata/PNObject.xcscmblueprint new file mode 100644 index 0000000..2121bc7 --- /dev/null +++ b/Example/PNObject.xcworkspace/xcshareddata/PNObject.xcscmblueprint @@ -0,0 +1,30 @@ +{ + "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "0D16AB9035733B66D1E42542FCF79AEB110EE3F1", + "DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : { + + }, + "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : { + "0D16AB9035733B66D1E42542FCF79AEB110EE3F1" : 0, + "AEB0552E99BCD7202184FC09F243A3865259D36E" : 0 + }, + "DVTSourceControlWorkspaceBlueprintIdentifierKey" : "63EBCBA7-0EA2-45A7-A0E5-D9B371244728", + "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : { + "0D16AB9035733B66D1E42542FCF79AEB110EE3F1" : "PNObject\/", + "AEB0552E99BCD7202184FC09F243A3865259D36E" : "..\/..\/..\/Purplenetwork\/GIT\/iOS\/packman-ios" + }, + "DVTSourceControlWorkspaceBlueprintNameKey" : "PNObject", + "DVTSourceControlWorkspaceBlueprintVersion" : 204, + "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "Example\/PNObject.xcworkspace", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [ + { + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "git.giuseppenucifora.com:giuseppenucifora\/PNObject.git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "0D16AB9035733B66D1E42542FCF79AEB110EE3F1" + }, + { + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "git.giuseppenucifora.com:purplenetwork\/packman-ios.git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "AEB0552E99BCD7202184FC09F243A3865259D36E" + } + ] +} \ No newline at end of file diff --git a/PNObject.podspec b/PNObject.podspec index 17bc334..49a8d7e 100644 --- a/PNObject.podspec +++ b/PNObject.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |s| s.name = "PNObject" -s.version = "0.4.5" +s.version = "0.4.6" 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/PNUser.m b/Pod/Classes/PNClasses/PNUser.m index 2647c91..62552c3 100644 --- a/Pod/Classes/PNClasses/PNUser.m +++ b/Pod/Classes/PNClasses/PNUser.m @@ -143,8 +143,8 @@ static bool isFirstAccess = YES; NSLogDebug(@"%@",[responseObject objectForKey:@"user"]); - [self populateObjectFromJSON:[responseObject objectForKey:@"user"]]; - [self saveLocally]; + [[[self class] currentUser] populateObjectFromJSON:[responseObject objectForKey:@"user"]]; + [[[self class] currentUser] saveLocally]; [[NSNotificationCenter defaultCenter] postNotificationName:PNObjectLocalNotificationUserReloadFromServerSuccess object:nil]; } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) { @@ -163,8 +163,9 @@ static bool isFirstAccess = YES; success:^(NSURLSessionDataTask * _Nullable task, NSDictionary * _Nullable responseObject) { NSLog(@"response %@",responseObject); if(success){ - success(self); - [self saveLocally]; + [[[self class] currentUser] saveLocally]; + success([[self class] currentUser]); + } } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) { NSLogDebug(@"error : %ld",(long)[error code]); @@ -286,7 +287,7 @@ static bool isFirstAccess = YES; [user saveLocally]; if (success) { - success(user); + success([self currentUser]); } } } failure:failure]; @@ -308,8 +309,8 @@ static bool isFirstAccess = YES; if (success) { success(responseObject); } - [[PNUser currentUser] setProfileImage:avatar]; - [[PNUser currentUser] reloadFormServer]; + [[self currentUser] setProfileImage:avatar]; + [[self currentUser] reloadFormServer]; } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) { if (failure) { failure(error);