@@ -70,7 +70,7 @@ @implementation PFUser (Private)
7070
7171- (void )setDefaultValues {
7272 [super setDefaultValues ];
73- self.isCurrentUser = NO ;
73+ self._current = NO ;
7474}
7575
7676- (BOOL )needsDefaultACL {
@@ -136,7 +136,7 @@ + (void)_assertValidInstanceClassName:(NSString *)className {
136136// Checks the properties on the object before saving.
137137- (void )_checkSaveParametersWithCurrentUser : (PFUser *)currentUser {
138138 @synchronized ([self lock ]) {
139- PFConsistencyAssert (self.objectId || self.isLazy ,
139+ PFConsistencyAssert (self.objectId || self._lazy ,
140140 @" User cannot be saved unless they are already signed up. Call signUp first." );
141141
142142 PFConsistencyAssert ([self _isAuthenticatedWithCurrentUser: currentUser] ||
@@ -181,7 +181,7 @@ - (NSMutableDictionary *)_convertToDictionaryForSaving:(PFOperationSet *)changes
181181
182182- (BFTask *)handleSaveResultAsync : (NSDictionary *)result {
183183 return [[super handleSaveResultAsync: result] continueWithSuccessBlock: ^id (BFTask *saveTask) {
184- if (self.isCurrentUser ) {
184+ if (self._current ) {
185185 [self cleanUpAuthData ];
186186 PFCurrentUserController *controller = [[self class ] currentUserController ];
187187 return [[controller saveCurrentObjectAsync: self ] continueWithBlock: ^id (BFTask *task) {
@@ -233,7 +233,7 @@ - (BFTask *)_handleServiceLoginCommandResult:(PFCommandResult *)result {
233233 }];
234234 }
235235 if (resultDictionary) {
236- self.isLazy = NO ;
236+ self._lazy = NO ;
237237
238238 // Serialize the object to disk so we can later access it via currentUser
239239 PFCurrentUserController *controller = [[self class ] currentUserController ];
@@ -271,7 +271,7 @@ - (BFTask *)handleSignUpResultAsync:(BFTask *)task {
271271 state.sessionToken = result[PFUserSessionTokenRESTKey];
272272 state.isNew = YES ;
273273 }];
274- self.isLazy = NO ;
274+ self._lazy = NO ;
275275 }
276276 }
277277 return signUpTask;
@@ -380,7 +380,7 @@ - (void)_mergeFromServerWithResult:(NSDictionary *)result decoder:(PFDecoder *)d
380380
381381- (void )synchronizeAuthDataWithAuthType : (NSString *)authType {
382382 @synchronized ([self lock ]) {
383- if (!self.isCurrentUser ) {
383+ if (!self._current ) {
384384 return ;
385385 }
386386
@@ -407,13 +407,13 @@ - (void)synchronizeAllAuthData {
407407
408408- (BFTask *)resolveLazinessAsync : (BFTask *)toAwait {
409409 @synchronized ([self lock ]) {
410- if (!self.isLazy ) {
410+ if (!self._lazy ) {
411411 return [BFTask taskWithResult: self ];
412412 }
413413 if (self.linkedServiceNames .count == 0 ) {
414414 // If there are no linked services, treat this like a sign-up.
415415 return [[self signUpAsync: toAwait] continueAsyncWithSuccessBlock: ^id (BFTask *task) {
416- self.isLazy = NO ;
416+ self._lazy = NO ;
417417 return self;
418418 }];
419419 }
@@ -458,8 +458,8 @@ - (BFTask *)_logOutAsyncWithAuthType:(NSString *)authType {
458458+ (instancetype )logInLazyUserWithAuthType : (NSString *)authType authData : (NSDictionary *)authData {
459459 PFUser *user = [self user ];
460460 @synchronized ([user lock ]) {
461- [ user setIsCurrentUser: YES ] ;
462- user.isLazy = YES ;
461+ user. _current = YES ;
462+ user._lazy = YES ;
463463 user.authData [authType] = authData;
464464 [user.linkedServiceNames addObject: authType];
465465 }
@@ -497,7 +497,7 @@ - (BFTask *)signUpAsync:(BFTask *)toAwait {
497497 // self doesn't have any outstanding saves, so we can safely merge its operations
498498 // into the current user.
499499
500- PFConsistencyAssert (!isCurrentUser , @" Attempt to merge currentUser with itself." );
500+ PFConsistencyAssert (!self. _current , @" Attempt to merge currentUser with itself." );
501501
502502 @synchronized ([currentUser lock ]) {
503503 NSString *oldUsername = [currentUser.username copy ];
@@ -603,7 +603,7 @@ - (PFRESTCommand *)_constructSaveCommandForChanges:(PFOperationSet *)changes
603603 objectEncoder : (PFEncoder *)encoder {
604604 // If we are curent user - use the latest available session token, as it might have been changed since
605605 // this command was enqueued.
606- if (self.isCurrentUser ) {
606+ if (self._current ) {
607607 token = self.sessionToken ;
608608 }
609609 return [super _constructSaveCommandForChanges: changes
@@ -770,9 +770,10 @@ @implementation PFUser
770770@dynamic password;
771771
772772// PFUser (Private):
773- @dynamic authData;
774- @dynamic linkedServiceNames;
775- @dynamic isLazy;
773+ @synthesize authData = _authData;
774+ @synthesize linkedServiceNames = _linkedServiceNames;
775+ @synthesize _current = _current;
776+ @synthesize _lazy = _lazy;
776777
777778+ (NSString *)parseClassName {
778779 return @" _User" ;
@@ -783,15 +784,15 @@ + (instancetype)currentUser {
783784 return [[controller getCurrentObjectAsync ] waitForResult: nil withMainThreadWarning: NO ];
784785}
785786
786- - (BOOL )isCurrentUser {
787+ - (BOOL )_current {
787788 @synchronized (self.lock ) {
788- return isCurrentUser ;
789+ return _current ;
789790 }
790791}
791792
792- - (void )setIsCurrentUser : (BOOL )aBool {
793+ - (void )set_current : (BOOL )current {
793794 @synchronized (self.lock ) {
794- isCurrentUser = aBool ;
795+ _current = current ;
795796 }
796797}
797798
@@ -985,7 +986,7 @@ - (BFTask *)_logOutAsync {
985986 [tasks addObject: task];
986987 }];
987988
988- self.isCurrentUser = NO ;
989+ self._current = NO ;
989990
990991 token = [self .sessionToken copy ];
991992
@@ -1025,20 +1026,20 @@ - (void)removeObjectForKey:(NSString *)key {
10251026
10261027- (NSMutableDictionary *)authData {
10271028 @synchronized ([self lock ]) {
1028- if (!authData ) {
1029- authData = [[NSMutableDictionary alloc ] init ];
1029+ if (!_authData ) {
1030+ _authData = [[NSMutableDictionary alloc ] init ];
10301031 }
10311032 }
1032- return authData ;
1033+ return _authData ;
10331034}
10341035
10351036- (NSMutableSet *)linkedServiceNames {
10361037 @synchronized ([self lock ]) {
1037- if (!linkedServiceNames ) {
1038- linkedServiceNames = [[NSMutableSet alloc ] init ];
1038+ if (!_linkedServiceNames ) {
1039+ _linkedServiceNames = [[NSMutableSet alloc ] init ];
10391040 }
10401041 }
1041- return linkedServiceNames ;
1042+ return _linkedServiceNames ;
10421043}
10431044
10441045+ (instancetype )user {
@@ -1054,7 +1055,7 @@ - (BFTask *)saveAsync:(BFTask *)toAwait {
10541055 // but not always. Using continueAsyncWithBlock unlocks from the taskQueue, and solves the proplem.
10551056 return [toAwait continueAsyncWithBlock: ^id (BFTask *task) {
10561057 @synchronized ([self lock ]) {
1057- if (self.isLazy ) {
1058+ if (self._lazy ) {
10581059 return [[self resolveLazinessAsync: toAwait] continueAsyncWithSuccessBlock: ^id (BFTask *task) {
10591060 return @(!!task.result );
10601061 }];
@@ -1066,12 +1067,12 @@ - (BFTask *)saveAsync:(BFTask *)toAwait {
10661067}
10671068
10681069- (BFTask *)fetchAsync : (BFTask *)toAwait {
1069- if (self.isLazy ) {
1070+ if (self._lazy ) {
10701071 return [BFTask taskWithResult: @YES ];
10711072 }
10721073
10731074 return [[super fetchAsync: toAwait] continueAsyncWithSuccessBlock: ^id (BFTask *fetchAsyncTask) {
1074- if (self.isCurrentUser ) {
1075+ if (self._current ) {
10751076 [self cleanUpAuthData ];
10761077 PFCurrentUserController *controller = [[self class ] currentUserController ];
10771078 return [[controller saveCurrentObjectAsync: self ] continueAsyncWithBlock: ^id (BFTask *task) {
@@ -1083,14 +1084,14 @@ - (BFTask *)fetchAsync:(BFTask *)toAwait {
10831084}
10841085
10851086- (instancetype )fetch : (NSError **)error {
1086- if (self.isLazy ) {
1087+ if (self._lazy ) {
10871088 return self;
10881089 }
10891090 return [super fetch: error];
10901091}
10911092
10921093- (void )fetchInBackgroundWithBlock : (PFObjectResultBlock)block {
1093- if (self.isLazy ) {
1094+ if (self._lazy ) {
10941095 if (block) {
10951096 block (self, nil );
10961097 return ;
@@ -1116,11 +1117,11 @@ - (BOOL)isAuthenticated {
11161117
11171118- (BOOL )_isAuthenticatedWithCurrentUser : (PFUser *)currentUser {
11181119 @synchronized ([self lock ]) {
1119- BOOL authenticated = self.isLazy || self.sessionToken ;
1120+ BOOL authenticated = self._lazy || self.sessionToken ;
11201121 if (!authenticated && currentUser != nil ) {
11211122 authenticated = [self .objectId isEqualToString: currentUser.objectId];
11221123 } else {
1123- authenticated = self.isCurrentUser ;
1124+ authenticated = self._current ;
11241125 }
11251126 return authenticated;
11261127 }
@@ -1140,7 +1141,7 @@ - (void)signUpInBackgroundWithBlock:(PFBooleanResultBlock)block {
11401141 // For anonymous users, there may be an objectId. Setting the userName
11411142 // will have removed the anonymous link and set the value in the authData
11421143 // object to [NSNull null], so we can just treat it like a save operation.
1143- if (authData[PFAnonymousUserAuthenticationType] == [NSNull null ]) {
1144+ if (self. authData [PFAnonymousUserAuthenticationType] == [NSNull null ]) {
11441145 [self saveInBackgroundWithBlock: block];
11451146 return ;
11461147 }
0 commit comments