From 1b91a470a659c73dcea74afec76f720cb53c2154 Mon Sep 17 00:00:00 2001 From: "Andrew W. Donoho" Date: Wed, 2 Sep 2015 16:15:21 -0500 Subject: [PATCH] Changes to the API headers to address Swift v2 issues using try-catch. --- Parse/PFObject.h | 40 ++++++++++++++++++++-------------------- Parse/PFQuery.h | 12 ++++++------ 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/Parse/PFObject.h b/Parse/PFObject.h index ba829e0e1..a83fce969 100644 --- a/Parse/PFObject.h +++ b/Parse/PFObject.h @@ -300,7 +300,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS @returns Returns whether the save succeeded. */ -- (BOOL)save; +- (BOOL)save NS_SWIFT_UNAVAILABLE("Breaks try-catch"); /*! @abstract *Synchronously* saves the `PFObject` and sets an error if it occurs. @@ -387,7 +387,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS @returns Returns whether the save succeeded. */ -+ (BOOL)saveAll:(PF_NULLABLE NSArray *)objects; ++ (BOOL)saveAll:(PF_NULLABLE NSArray *)objects NS_SWIFT_UNAVAILABLE("Breaks try-catch"); /*! @abstract Saves a collection of objects *synchronously* all at once and sets an error if necessary. @@ -443,7 +443,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS @returns Returns whether the delete succeeded. */ -+ (BOOL)deleteAll:(PF_NULLABLE NSArray *)objects; ++ (BOOL)deleteAll:(PF_NULLABLE NSArray *)objects NS_SWIFT_UNAVAILABLE("Breaks try-catch"); /*! @abstract *Synchronously* deletes a collection of objects all at once and sets an error if necessary. @@ -504,7 +504,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS @deprecated Please use `-fetch` instead. */ -- (void)refresh PARSE_DEPRECATED("Please use `-fetch` instead."); +- (void)refresh PARSE_DEPRECATED("Please use `-fetch` instead.") NS_SWIFT_UNAVAILABLE("Breaks try-catch"); /*! @abstract *Synchronously* refreshes the `PFObject` with the current data from the server and sets an error if it occurs. @@ -544,7 +544,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS /*! @abstract *Synchronously* fetches the PFObject with the current data from the server. */ -- (void)fetch; +- (void)fetch NS_SWIFT_UNAVAILABLE("Breaks try-catch"); /*! @abstract *Synchronously* fetches the PFObject with the current data from the server and sets an error if it occurs. @@ -555,7 +555,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS /*! @abstract *Synchronously* fetches the `PFObject` data from the server if is `NO`. */ -- (PF_NULLABLE PFObject *)fetchIfNeeded; +- (PF_NULLABLE PFObject *)fetchIfNeeded NS_SWIFT_UNAVAILABLE("Breaks try-catch"); /*! @abstract *Synchronously* fetches the `PFObject` data from the server if is `NO`. @@ -627,7 +627,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS @param objects The list of objects to fetch. */ -+ (void)fetchAll:(PF_NULLABLE NSArray *)objects; ++ (void)fetchAll:(PF_NULLABLE NSArray *)objects NS_SWIFT_UNAVAILABLE("Breaks try-catch"); /*! @abstract *Synchronously* fetches all of the `PFObject` objects with the current data from the server @@ -642,7 +642,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS @abstract *Synchronously* fetches all of the `PFObject` objects with the current data from the server. @param objects The list of objects to fetch. */ -+ (void)fetchAllIfNeeded:(PF_NULLABLE NSArray *)objects; ++ (void)fetchAllIfNeeded:(PF_NULLABLE NSArray *)objects NS_SWIFT_UNAVAILABLE("Breaks try-catch"); /*! @abstract *Synchronously* fetches all of the `PFObject` objects with the current data from the server @@ -731,7 +731,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS @abstract *Synchronously* loads data from the local datastore into this object, if it has not been fetched from the server already. */ -- (void)fetchFromLocalDatastore; +- (void)fetchFromLocalDatastore NS_SWIFT_UNAVAILABLE("Breaks try-catch"); /*! @abstract *Synchronously* loads data from the local datastore into this object, if it has not been fetched @@ -770,7 +770,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS @returns Returns whether the delete succeeded. */ -- (BOOL)delete; +- (BOOL)delete NS_SWIFT_UNAVAILABLE("Breaks try-catch"); /*! @abstract *Synchronously* deletes the `PFObject` and sets an error if it occurs. @@ -867,7 +867,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS @see unpin: @see PFObjectDefaultPin */ -- (BOOL)pin; +- (BOOL)pin NS_SWIFT_UNAVAILABLE("Breaks try-catch"); /*! @abstract *Synchronously* stores the object and every object it points to in the local datastore, recursively, @@ -901,7 +901,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS @see unpinWithName: */ -- (BOOL)pinWithName:(NSString *)name; +- (BOOL)pinWithName:(NSString *)name NS_SWIFT_UNAVAILABLE("Breaks try-catch"); /*! @abstract *Synchronously* stores the object and every object it points to in the local datastore, recursively. @@ -1006,7 +1006,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS @see unpinAll: @see PFObjectDefaultPin */ -+ (BOOL)pinAll:(PF_NULLABLE NSArray *)objects; ++ (BOOL)pinAll:(PF_NULLABLE NSArray *)objects NS_SWIFT_UNAVAILABLE("Breaks try-catch"); /*! @abstract *Synchronously* stores the objects and every object they point to in the local datastore, recursively, @@ -1042,7 +1042,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS @see unpinAll:withName: */ -+ (BOOL)pinAll:(PF_NULLABLE NSArray *)objects withName:(NSString *)name; ++ (BOOL)pinAll:(PF_NULLABLE NSArray *)objects withName:(NSString *)name NS_SWIFT_UNAVAILABLE("Breaks try-catch"); /*! @abstract *Synchronously* stores the objects and every object they point to in the local datastore, recursively. @@ -1149,7 +1149,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS @see pin: @see PFObjectDefaultPin */ -- (BOOL)unpin; +- (BOOL)unpin NS_SWIFT_UNAVAILABLE("Breaks try-catch"); /*! @abstract *Synchronously* removes the object and every object it points to in the local datastore, recursively, @@ -1173,7 +1173,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS @see pinWithName: */ -- (BOOL)unpinWithName:(NSString *)name; +- (BOOL)unpinWithName:(NSString *)name NS_SWIFT_UNAVAILABLE("Breaks try-catch"); /*! @abstract *Synchronously* removes the object and every object it points to in the local datastore, recursively. @@ -1245,7 +1245,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS @see PFObjectDefaultPin */ -+ (BOOL)unpinAllObjects; ++ (BOOL)unpinAllObjects NS_SWIFT_UNAVAILABLE("Breaks try-catch"); /*! @abstract *Synchronously* removes all objects in the local datastore @@ -1266,7 +1266,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS @returns Returns whether the unpin succeeded. */ -+ (BOOL)unpinAllObjectsWithName:(NSString *)name; ++ (BOOL)unpinAllObjectsWithName:(NSString *)name NS_SWIFT_UNAVAILABLE("Breaks try-catch"); /*! @abstract *Synchronously* removes all objects with the specified pin name. @@ -1329,7 +1329,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS @see pinAll: @see PFObjectDefaultPin */ -+ (BOOL)unpinAll:(PF_NULLABLE NSArray *)objects; ++ (BOOL)unpinAll:(PF_NULLABLE NSArray *)objects NS_SWIFT_UNAVAILABLE("Breaks try-catch"); /*! @abstract *Synchronously* removes the objects and every object they point to in the local datastore, recursively, @@ -1355,7 +1355,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS @see pinAll:withName: */ -+ (BOOL)unpinAll:(PF_NULLABLE NSArray *)objects withName:(NSString *)name; ++ (BOOL)unpinAll:(PF_NULLABLE NSArray *)objects withName:(NSString *)name NS_SWIFT_UNAVAILABLE("Breaks try-catch"); /*! @abstract *Synchronously* removes the objects and every object they point to in the local datastore, recursively. diff --git a/Parse/PFQuery.h b/Parse/PFQuery.h index e7fab6ef8..e615c2a35 100644 --- a/Parse/PFQuery.h +++ b/Parse/PFQuery.h @@ -501,7 +501,7 @@ PF_ASSUME_NONNULL_BEGIN @returns The if found. Returns `nil` if the object isn't found, or if there was an error. */ -+ (PF_NULLABLE PFObject *)getObjectOfClass:(NSString *)objectClass objectId:(NSString *)objectId; ++ (PF_NULLABLE PFObject *)getObjectOfClass:(NSString *)objectClass objectId:(NSString *)objectId NS_SWIFT_UNAVAILABLE("Breaks try-catch"); /*! @abstract Returns a with a given class and id and sets an error if necessary. @@ -526,7 +526,7 @@ PF_ASSUME_NONNULL_BEGIN @returns The if found. Returns nil if the object isn't found, or if there was an error. */ -- (PF_NULLABLE PFObject *)getObjectWithId:(NSString *)objectId; +- (PF_NULLABLE PFObject *)getObjectWithId:(NSString *)objectId NS_SWIFT_UNAVAILABLE("Breaks try-catch"); /*! @abstract Returns a with the given id and sets an error if necessary. @@ -592,7 +592,7 @@ PF_ASSUME_NONNULL_BEGIN @returns The PFUser if found. Returns nil if the object isn't found, or if there was an error. */ -+ (PF_NULLABLE PFUser *)getUserObjectWithId:(NSString *)objectId; ++ (PF_NULLABLE PFUser *)getUserObjectWithId:(NSString *)objectId NS_SWIFT_UNAVAILABLE("Breaks try-catch"); /*! Returns a PFUser with a given class and id and sets an error if necessary. @@ -617,7 +617,7 @@ PF_ASSUME_NONNULL_BEGIN @returns Returns an array of objects that were found. */ -- (PF_NULLABLE NSArray *)findObjects; +- (PF_NULLABLE NSArray *)findObjects NS_SWIFT_UNAVAILABLE("Breaks try-catch"); /*! @abstract Finds objects *synchronously* based on the constructed query and sets an error if there was one. @@ -664,7 +664,7 @@ PF_ASSUME_NONNULL_BEGIN @returns Returns a , or `nil` if none was found. */ -- (PF_NULLABLE PFObject *)getFirstObject; +- (PF_NULLABLE PFObject *)getFirstObject NS_SWIFT_UNAVAILABLE("Breaks try-catch"); /*! @abstract Gets an object *synchronously* based on the constructed query and sets an error if any occurred. @@ -720,7 +720,7 @@ PF_ASSUME_NONNULL_BEGIN @returns Returns the number of objects that match the query, or `-1` if there is an error. */ -- (NSInteger)countObjects; +- (NSInteger)countObjects NS_SWIFT_UNAVAILABLE("Breaks try-catch"); /*! @abstract Counts objects *synchronously* based on the constructed query and sets an error if there was one.