Skip to content

Commit 17a9ab6

Browse files
committed
Update usage of __nullable on types that support annotations.
1 parent 6a97148 commit 17a9ab6

File tree

8 files changed

+56
-57
lines changed

8 files changed

+56
-57
lines changed

Parse/PFAnonymousUtils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ NS_ASSUME_NONNULL_BEGIN
6262
@param selector The selector that will be called when the asynchronous request is complete.
6363
It should have the following signature: `(void)callbackWithUser:(PFUser *)user error:(NSError *)error`.
6464
*/
65-
+ (void)logInWithTarget:(__nullable id)target selector:(__nullable SEL)selector;
65+
+ (void)logInWithTarget:(nullable id)target selector:(nullable SEL)selector;
6666

6767
///--------------------------------------
6868
/// @name Determining Whether a User is Anonymous

Parse/PFCloud.h

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ NS_ASSUME_NONNULL_BEGIN
2828
2929
@returns The response from the cloud function.
3030
*/
31-
+ (__nullable id)callFunction:(NSString *)function
32-
withParameters:(nullable NSDictionary *)parameters PF_SWIFT_UNAVAILABLE;
31+
+ (nullable id)callFunction:(NSString *)function withParameters:(nullable NSDictionary *)parameters PF_SWIFT_UNAVAILABLE;
3332

3433
/*!
3534
@abstract Calls the given cloud function *synchronously* with the parameters provided and
@@ -42,9 +41,9 @@ NS_ASSUME_NONNULL_BEGIN
4241
@returns The response from the cloud function.
4342
This result could be a `NSDictionary`, an `NSArray`, `NSNumber` or `NSString`.
4443
*/
45-
+ (__nullable id)callFunction:(NSString *)function
46-
withParameters:(nullable NSDictionary *)parameters
47-
error:(NSError **)error;
44+
+ (nullable id)callFunction:(NSString *)function
45+
withParameters:(nullable NSDictionary *)parameters
46+
error:(NSError **)error;
4847

4948
/*!
5049
@abstract Calls the given cloud function *asynchronously* with the parameters provided.
@@ -83,8 +82,8 @@ NS_ASSUME_NONNULL_BEGIN
8382
*/
8483
+ (void)callFunctionInBackground:(NSString *)function
8584
withParameters:(nullable NSDictionary *)parameters
86-
target:(__nullable id)target
87-
selector:(__nullable SEL)selector;
85+
target:(nullable id)target
86+
selector:(nullable SEL)selector;
8887

8988
@end
9089

Parse/PFConfig.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ typedef void(^PFConfigResultBlock)(PFConfig *__nullable config, NSError *__nulla
8484
8585
@returns The value associated with `key`, or `nil` if there is no such value.
8686
*/
87-
- (__nullable id)objectForKey:(NSString *)key;
87+
- (nullable id)objectForKey:(NSString *)key;
8888

8989
/*!
9090
@abstract Returns the object associated with a given key.
@@ -98,7 +98,7 @@ typedef void(^PFConfigResultBlock)(PFConfig *__nullable config, NSError *__nulla
9898
9999
@returns The value associated with `key`, or `nil` if there is no such value.
100100
*/
101-
- (__nullable id)objectForKeyedSubscript:(NSString *)keyedSubscript;
101+
- (nullable id)objectForKeyedSubscript:(NSString *)keyedSubscript;
102102

103103
@end
104104

Parse/PFFile.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ NS_ASSUME_NONNULL_BEGIN
6262
@returns A new `PFFile` instance.
6363
*/
6464
+ (nullable instancetype)fileWithName:(nullable NSString *)name
65-
contentsAtPath:(NSString *)path PF_SWIFT_UNAVAILABLE;
65+
contentsAtPath:(NSString *)path PF_SWIFT_UNAVAILABLE;
6666

6767
/*!
6868
@abstract Creates a file with the contents of another file.
@@ -77,8 +77,8 @@ NS_ASSUME_NONNULL_BEGIN
7777
@returns A new `PFFile` instance or `nil` if the error occured.
7878
*/
7979
+ (nullable instancetype)fileWithName:(nullable NSString *)name
80-
contentsAtPath:(NSString *)path
81-
error:(NSError **)error;
80+
contentsAtPath:(NSString *)path
81+
error:(NSError **)error;
8282

8383
/*!
8484
@abstract Creates a file with given data, name and content type.
@@ -93,8 +93,8 @@ NS_ASSUME_NONNULL_BEGIN
9393
@returns A new `PFFile` instance.
9494
*/
9595
+ (nullable instancetype)fileWithName:(nullable NSString *)name
96-
data:(NSData *)data
97-
contentType:(nullable NSString *)contentType PF_SWIFT_UNAVAILABLE;
96+
data:(NSData *)data
97+
contentType:(nullable NSString *)contentType PF_SWIFT_UNAVAILABLE;
9898

9999
/*!
100100
@abstract Creates a file with given data, name and content type.
@@ -110,9 +110,9 @@ NS_ASSUME_NONNULL_BEGIN
110110
@returns A new `PFFile` instance or `nil` if the error occured.
111111
*/
112112
+ (nullable instancetype)fileWithName:(nullable NSString *)name
113-
data:(NSData *)data
114-
contentType:(nullable NSString *)contentType
115-
error:(NSError **)error;
113+
data:(NSData *)data
114+
contentType:(nullable NSString *)contentType
115+
error:(NSError **)error;
116116

117117
/*!
118118
@abstract Creates a file with given data and content type.
@@ -211,7 +211,7 @@ NS_ASSUME_NONNULL_BEGIN
211211
`error` will be `nil` on success and set if there was an error.
212212
`[result boolValue]` will tell you whether the call succeeded or not.
213213
*/
214-
- (void)saveInBackgroundWithTarget:(__nullable id)target selector:(__nullable SEL)selector;
214+
- (void)saveInBackgroundWithTarget:(nullable id)target selector:(nullable SEL)selector;
215215

216216
///--------------------------------------
217217
/// @name Getting Data from Parse
@@ -382,7 +382,7 @@ NS_ASSUME_NONNULL_BEGIN
382382
It should have the following signature: `(void)callbackWithResult:(NSData *)result error:(NSError *)error`.
383383
`error` will be `nil` on success and set if there was an error.
384384
*/
385-
- (void)getDataInBackgroundWithTarget:(__nullable id)target selector:(__nullable SEL)selector;
385+
- (void)getDataInBackgroundWithTarget:(nullable id)target selector:(nullable SEL)selector;
386386

387387
/*!
388388
@abstract *Asynchronously* gets the file path for file from cache if available or fetches its contents from the network.

Parse/PFObject.h

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
136136
137137
@param key The key for which to return the corresponding value.
138138
*/
139-
- (__nullable id)objectForKey:(NSString *)key;
139+
- (nullable id)objectForKey:(NSString *)key;
140140

141141
/*!
142142
@abstract Sets the object associated with a given key.
@@ -168,7 +168,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
168168
169169
@see objectForKey:
170170
*/
171-
- (__nullable id)objectForKeyedSubscript:(NSString *)key;
171+
- (nullable id)objectForKeyedSubscript:(NSString *)key;
172172

173173
/*!
174174
@abstract Returns the value associated with a given key.
@@ -335,7 +335,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
335335
`error` will be `nil` on success and set if there was an error.
336336
`[result boolValue]` will tell you whether the call succeeded or not.
337337
*/
338-
- (void)saveInBackgroundWithTarget:(__nullable id)target selector:(__nullable SEL)selector;
338+
- (void)saveInBackgroundWithTarget:(nullable id)target selector:(nullable SEL)selector;
339339

340340
/*!
341341
@abstract Saves this object to the server at some unspecified time in the future,
@@ -429,8 +429,8 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
429429
`[result boolValue]` will tell you whether the call succeeded or not.
430430
*/
431431
+ (void)saveAllInBackground:(nullable NSArray PF_GENERIC(PFObject *)*)objects
432-
target:(__nullable id)target
433-
selector:(__nullable SEL)selector;
432+
target:(nullable id)target
433+
selector:(nullable SEL)selector;
434434

435435
///--------------------------------------
436436
/// @name Deleting Many Objects
@@ -483,8 +483,8 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
483483
`[result boolValue]` will tell you whether the call succeeded or not.
484484
*/
485485
+ (void)deleteAllInBackground:(nullable NSArray PF_GENERIC(PFObject *)*)objects
486-
target:(__nullable id)target
487-
selector:(__nullable SEL)selector;
486+
target:(nullable id)target
487+
selector:(nullable SEL)selector;
488488

489489
///--------------------------------------
490490
/// @name Getting an Object
@@ -536,8 +536,8 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
536536
537537
@deprecated Please use `fetchInBackgroundWithTarget:selector:` instead.
538538
*/
539-
- (void)refreshInBackgroundWithTarget:(__nullable id)target
540-
selector:(__nullable SEL)selector PARSE_DEPRECATED("Please use `fetchInBackgroundWithTarget:selector:` instead.");
539+
- (void)refreshInBackgroundWithTarget:(nullable id)target
540+
selector:(nullable SEL)selector PARSE_DEPRECATED("Please use `fetchInBackgroundWithTarget:selector:` instead.");
541541

542542
#endif
543543

@@ -588,7 +588,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
588588
`error` will be `nil` on success and set if there was an error.
589589
`refreshedObject` will be the `PFObject` with the refreshed data.
590590
*/
591-
- (void)fetchInBackgroundWithTarget:(__nullable id)target selector:(__nullable SEL)selector;
591+
- (void)fetchInBackgroundWithTarget:(nullable id)target selector:(nullable SEL)selector;
592592

593593
/*!
594594
@abstract Fetches the `PFObject` data *asynchronously* if isDataAvailable is `NO`,
@@ -615,7 +615,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
615615
`error` will be `nil` on success and set if there was an error.
616616
`refreshedObject` will be the `PFObject` with the refreshed data.
617617
*/
618-
- (void)fetchIfNeededInBackgroundWithTarget:(__nullable id)target selector:(__nullable SEL)selector;
618+
- (void)fetchIfNeededInBackgroundWithTarget:(nullable id)target selector:(nullable SEL)selector;
619619

620620
///--------------------------------------
621621
/// @name Getting Many Objects
@@ -636,7 +636,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
636636
@param error Pointer to an `NSError` that will be set if necessary.
637637
*/
638638
+ (nullable NSArray PF_GENERIC(__kindof PFObject *)*)fetchAll:(nullable NSArray PF_GENERIC(PFObject *)*)objects
639-
error:(NSError **)error;
639+
error:(NSError **)error;
640640

641641
/*!
642642
@abstract *Synchronously* fetches all of the `PFObject` objects with the current data from the server.
@@ -652,7 +652,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
652652
@param error Pointer to an `NSError` that will be set if necessary.
653653
*/
654654
+ (nullable NSArray PF_GENERIC(__kindof PFObject *)*)fetchAllIfNeeded:(nullable NSArray PF_GENERIC(PFObject *)*)objects
655-
error:(NSError **)error;
655+
error:(NSError **)error;
656656

657657
/*!
658658
@abstract Fetches all of the `PFObject` objects with the current data from the server *asynchronously*.
@@ -686,8 +686,8 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
686686
`fetchedObjects` will the array of `PFObject` objects that were fetched.
687687
*/
688688
+ (void)fetchAllInBackground:(nullable NSArray PF_GENERIC(PFObject *)*)objects
689-
target:(__nullable id)target
690-
selector:(__nullable SEL)selector;
689+
target:(nullable id)target
690+
selector:(nullable SEL)selector;
691691

692692
/*!
693693
@abstract Fetches all of the `PFObject` objects with the current data from the server *asynchronously*.
@@ -721,8 +721,8 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
721721
`fetchedObjects` will the array of `PFObject` objects that were fetched.
722722
*/
723723
+ (void)fetchAllIfNeededInBackground:(nullable NSArray PF_GENERIC(PFObject *)*)objects
724-
target:(__nullable id)target
725-
selector:(__nullable SEL)selector;
724+
target:(nullable id)target
725+
selector:(nullable SEL)selector;
726726

727727
///--------------------------------------
728728
/// @name Fetching From Local Datastore
@@ -806,8 +806,8 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
806806
`error` will be `nil` on success and set if there was an error.
807807
`[result boolValue]` will tell you whether the call succeeded or not.
808808
*/
809-
- (void)deleteInBackgroundWithTarget:(__nullable id)target
810-
selector:(__nullable SEL)selector;
809+
- (void)deleteInBackgroundWithTarget:(nullable id)target
810+
selector:(nullable SEL)selector;
811811

812812
/*!
813813
@abstract Deletes this object from the server at some unspecified time in the future,

Parse/PFPush.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -484,8 +484,8 @@ PF_TV_UNAVAILABLE PF_WATCH_UNAVAILABLE @interface PFPush : NSObject <NSCopying>
484484
`[result boolValue]` will tell you whether the call succeeded or not.
485485
*/
486486
+ (void)subscribeToChannelInBackground:(NSString *)channel
487-
target:(__nullable id)target
488-
selector:(__nullable SEL)selector;
487+
target:(nullable id)target
488+
selector:(nullable SEL)selector;
489489

490490
/*!
491491
@abstract *Synchronously* unsubscribes the device to a channel of push notifications.
@@ -527,8 +527,8 @@ PF_TV_UNAVAILABLE PF_WATCH_UNAVAILABLE @interface PFPush : NSObject <NSCopying>
527527
`[result boolValue]` will tell you whether the call succeeded or not.
528528
*/
529529
+ (void)unsubscribeFromChannelInBackground:(NSString *)channel
530-
target:(__nullable id)target
531-
selector:(__nullable SEL)selector;
530+
target:(nullable id)target
531+
selector:(nullable SEL)selector;
532532

533533
@end
534534

Parse/PFQuery.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ typedef void (^PFQueryArrayResultBlock)(NSArray PF_GENERIC(PFGenericObject) * __
508508
@returns The <PFObject> if found. Returns `nil` if the object isn't found, or if there was an error.
509509
*/
510510
+ (nullable PFGenericObject)getObjectOfClass:(NSString *)objectClass
511-
objectId:(NSString *)objectId PF_SWIFT_UNAVAILABLE;
511+
objectId:(NSString *)objectId PF_SWIFT_UNAVAILABLE;
512512

513513
/*!
514514
@abstract Returns a <PFObject> with a given class and id and sets an error if necessary.
@@ -520,8 +520,8 @@ typedef void (^PFQueryArrayResultBlock)(NSArray PF_GENERIC(PFGenericObject) * __
520520
@returns The <PFObject> if found. Returns `nil` if the object isn't found, or if there was an `error`.
521521
*/
522522
+ (nullable PFGenericObject)getObjectOfClass:(NSString *)objectClass
523-
objectId:(NSString *)objectId
524-
error:(NSError **)error;
523+
objectId:(NSString *)objectId
524+
error:(NSError **)error;
525525

526526
/*!
527527
@abstract Returns a <PFObject> with the given id.
@@ -585,8 +585,8 @@ typedef void (^PFQueryArrayResultBlock)(NSArray PF_GENERIC(PFGenericObject) * __
585585
Result will be `nil` if error is set and vice versa.
586586
*/
587587
- (void)getObjectInBackgroundWithId:(NSString *)objectId
588-
target:(__nullable id)target
589-
selector:(__nullable SEL)selector;
588+
target:(nullable id)target
589+
selector:(nullable SEL)selector;
590590

591591
///--------------------------------------
592592
/// @name Getting User Objects
@@ -657,7 +657,7 @@ typedef void (^PFQueryArrayResultBlock)(NSArray PF_GENERIC(PFGenericObject) * __
657657
It should have the following signature: `(void)callbackWithResult:(id)result error:(NSError *)error`.
658658
Result will be `nil` if error is set and vice versa.
659659
*/
660-
- (void)findObjectsInBackgroundWithTarget:(__nullable id)target selector:(__nullable SEL)selector;
660+
- (void)findObjectsInBackgroundWithTarget:(nullable id)target selector:(nullable SEL)selector;
661661

662662
///--------------------------------------
663663
/// @name Getting the First Match in a Query
@@ -715,7 +715,7 @@ typedef void (^PFQueryArrayResultBlock)(NSArray PF_GENERIC(PFGenericObject) * __
715715
`result` will be `nil` if `error` is set OR no object was found matching the query.
716716
`error` will be `nil` if `result` is set OR if the query succeeded, but found no results.
717717
*/
718-
- (void)getFirstObjectInBackgroundWithTarget:(__nullable id)target selector:(__nullable SEL)selector;
718+
- (void)getFirstObjectInBackgroundWithTarget:(nullable id)target selector:(nullable SEL)selector;
719719

720720
///--------------------------------------
721721
/// @name Counting the Matches in a Query
@@ -759,7 +759,7 @@ typedef void (^PFQueryArrayResultBlock)(NSArray PF_GENERIC(PFGenericObject) * __
759759
@param selector The selector to call.
760760
It should have the following signature: `(void)callbackWithResult:(NSNumber *)result error:(NSError *)error`.
761761
*/
762-
- (void)countObjectsInBackgroundWithTarget:(__nullable id)target selector:(__nullable SEL)selector;
762+
- (void)countObjectsInBackgroundWithTarget:(nullable id)target selector:(nullable SEL)selector;
763763

764764
///--------------------------------------
765765
/// @name Cancelling a Query

Parse/PFUser.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ typedef void(^PFUserLogoutResultBlock)(NSError *__nullable error);
170170
`error` will be `nil` on success and set if there was an error.
171171
`[result boolValue]` will tell you whether the call succeeded or not.
172172
*/
173-
- (void)signUpInBackgroundWithTarget:(__nullable id)target selector:(__nullable SEL)selector;
173+
- (void)signUpInBackgroundWithTarget:(nullable id)target selector:(nullable SEL)selector;
174174

175175
///--------------------------------------
176176
/// @name Logging In
@@ -189,7 +189,7 @@ typedef void(^PFUserLogoutResultBlock)(NSError *__nullable error);
189189
If login failed for either wrong password or wrong username, returns `nil`.
190190
*/
191191
+ (nullable instancetype)logInWithUsername:(NSString *)username
192-
password:(NSString *)password PF_SWIFT_UNAVAILABLE;
192+
password:(NSString *)password PF_SWIFT_UNAVAILABLE;
193193

194194
/*!
195195
@abstract Makes a *synchronous* request to login a user with specified credentials.
@@ -205,8 +205,8 @@ typedef void(^PFUserLogoutResultBlock)(NSError *__nullable error);
205205
If login failed for either wrong password or wrong username, returns `nil`.
206206
*/
207207
+ (nullable instancetype)logInWithUsername:(NSString *)username
208-
password:(NSString *)password
209-
error:(NSError **)error;
208+
password:(NSString *)password
209+
error:(NSError **)error;
210210

211211
/*!
212212
@abstract Makes an *asynchronous* request to login a user with specified credentials.
@@ -236,8 +236,8 @@ typedef void(^PFUserLogoutResultBlock)(NSError *__nullable error);
236236
*/
237237
+ (void)logInWithUsernameInBackground:(NSString *)username
238238
password:(NSString *)password
239-
target:(__nullable id)target
240-
selector:(__nullable SEL)selector;
239+
target:(nullable id)target
240+
selector:(nullable SEL)selector;
241241

242242
/*!
243243
@abstract Makes an *asynchronous* request to log in a user with specified credentials.

0 commit comments

Comments
 (0)