Skip to content

Commit c8c413f

Browse files
committed
Updated nullability annotations and return types for synchronous methods on PFObject.
1 parent 2e899eb commit c8c413f

File tree

2 files changed

+15
-16
lines changed

2 files changed

+15
-16
lines changed

Parse/PFObject.h

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
184184
185185
@see setObject:forKey:
186186
*/
187-
- (void)setObject:(PF_NULLABLE_S id)object forKeyedSubscript:(NSString *)key;
187+
- (void)setObject:(id)object forKeyedSubscript:(NSString *)key;
188188

189189
/*!
190190
@abstract Returns the relation object associated with the given key.
@@ -504,7 +504,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
504504
505505
@deprecated Please use `-fetch` instead.
506506
*/
507-
- (instancetype)refresh PF_SWIFT_UNAVAILABLE PARSE_DEPRECATED("Please use `-fetch` instead.");
507+
- (PF_NULLABLE instancetype)refresh PF_SWIFT_UNAVAILABLE PARSE_DEPRECATED("Please use `-fetch` instead.");
508508

509509
/*!
510510
@abstract *Synchronously* refreshes the `PFObject` with the current data from the server and sets an error if it occurs.
@@ -513,7 +513,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
513513
514514
@deprecated Please use `-fetch:` instead.
515515
*/
516-
- (instancetype)refresh:(NSError **)error PARSE_DEPRECATED("Please use `-fetch:` instead.");
516+
- (PF_NULLABLE instancetype)refresh:(NSError **)error PARSE_DEPRECATED("Please use `-fetch:` instead.");
517517

518518
/*!
519519
@abstract *Asynchronously* refreshes the `PFObject` and executes the given callback block.
@@ -544,25 +544,25 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
544544
/*!
545545
@abstract *Synchronously* fetches the PFObject with the current data from the server.
546546
*/
547-
- (instancetype)fetch PF_SWIFT_UNAVAILABLE;
547+
- (PF_NULLABLE instancetype)fetch PF_SWIFT_UNAVAILABLE;
548548
/*!
549549
@abstract *Synchronously* fetches the PFObject with the current data from the server and sets an error if it occurs.
550550
551551
@param error Pointer to an `NSError` that will be set if necessary.
552552
*/
553-
- (instancetype)fetch:(NSError **)error;
553+
- (PF_NULLABLE instancetype)fetch:(NSError **)error;
554554

555555
/*!
556556
@abstract *Synchronously* fetches the `PFObject` data from the server if <isDataAvailable> is `NO`.
557557
*/
558-
- (PF_NULLABLE PFObject *)fetchIfNeeded PF_SWIFT_UNAVAILABLE;
558+
- (PF_NULLABLE instancetype)fetchIfNeeded PF_SWIFT_UNAVAILABLE;
559559

560560
/*!
561561
@abstract *Synchronously* fetches the `PFObject` data from the server if <isDataAvailable> is `NO`.
562562
563563
@param error Pointer to an `NSError` that will be set if necessary.
564564
*/
565-
- (PF_NULLABLE PFObject *)fetchIfNeeded:(NSError **)error;
565+
- (PF_NULLABLE instancetype)fetchIfNeeded:(NSError **)error;
566566

567567
/*!
568568
@abstract Fetches the `PFObject` *asynchronously* and sets it as a result for the task.
@@ -615,8 +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:(PF_NULLABLE_S id)target
619-
selector:(PF_NULLABLE_S SEL)selector;
618+
- (void)fetchIfNeededInBackgroundWithTarget:(PF_NULLABLE_S id)target selector:(PF_NULLABLE_S SEL)selector;
620619

621620
///--------------------------------------
622621
/// @name Getting Many Objects
@@ -627,7 +626,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
627626
628627
@param objects The list of objects to fetch.
629628
*/
630-
+ (NSArray *)fetchAll:(PF_NULLABLE NSArray *)objects PF_SWIFT_UNAVAILABLE;
629+
+ (PF_NULLABLE NSArray *)fetchAll:(PF_NULLABLE NSArray *)objects PF_SWIFT_UNAVAILABLE;
631630

632631
/*!
633632
@abstract *Synchronously* fetches all of the `PFObject` objects with the current data from the server
@@ -636,13 +635,13 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
636635
@param objects The list of objects to fetch.
637636
@param error Pointer to an `NSError` that will be set if necessary.
638637
*/
639-
+ (NSArray *)fetchAll:(PF_NULLABLE NSArray *)objects error:(NSError **)error;
638+
+ (PF_NULLABLE NSArray *)fetchAll:(PF_NULLABLE NSArray *)objects error:(NSError **)error;
640639

641640
/*!
642641
@abstract *Synchronously* fetches all of the `PFObject` objects with the current data from the server.
643642
@param objects The list of objects to fetch.
644643
*/
645-
+ (NSArray *)fetchAllIfNeeded:(PF_NULLABLE NSArray *)objects PF_SWIFT_UNAVAILABLE;
644+
+ (PF_NULLABLE NSArray *)fetchAllIfNeeded:(PF_NULLABLE NSArray *)objects PF_SWIFT_UNAVAILABLE;
646645

647646
/*!
648647
@abstract *Synchronously* fetches all of the `PFObject` objects with the current data from the server
@@ -651,7 +650,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
651650
@param objects The list of objects to fetch.
652651
@param error Pointer to an `NSError` that will be set if necessary.
653652
*/
654-
+ (NSArray *)fetchAllIfNeeded:(PF_NULLABLE NSArray *)objects error:(NSError **)error;
653+
+ (PF_NULLABLE NSArray *)fetchAllIfNeeded:(PF_NULLABLE NSArray *)objects error:(NSError **)error;
655654

656655
/*!
657656
@abstract Fetches all of the `PFObject` objects with the current data from the server *asynchronously*.
@@ -731,7 +730,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
731730
@abstract *Synchronously* loads data from the local datastore into this object,
732731
if it has not been fetched from the server already.
733732
*/
734-
- (instancetype)fetchFromLocalDatastore PF_SWIFT_UNAVAILABLE;
733+
- (PF_NULLABLE instancetype)fetchFromLocalDatastore PF_SWIFT_UNAVAILABLE;
735734

736735
/*!
737736
@abstract *Synchronously* loads data from the local datastore into this object, if it has not been fetched
@@ -742,7 +741,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
742741
743742
@param error Pointer to an `NSError` that will be set if necessary.
744743
*/
745-
- (instancetype)fetchFromLocalDatastore:(NSError **)error;
744+
- (PF_NULLABLE instancetype)fetchFromLocalDatastore:(NSError **)error;
746745

747746
/*!
748747
@abstract *Asynchronously* loads data from the local datastore into this object,

Parse/PFUser.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ typedef void(^PFUserLogoutResultBlock)(NSError *PF_NULLABLE_S error);
7878
7979
@returns Returns a new `PFUser` object.
8080
*/
81-
+ (PFUser *)user;
81+
+ (instancetype)user;
8282

8383
/*!
8484
@abstract Enables automatic creation of anonymous users.

0 commit comments

Comments
 (0)