PFQuery(Synchronous)

@interface PFQuery < PFGenericObject : PFObject * >
(Synchronous) @end

This category lists all methods of PFQuery class that are synchronous, but have asynchronous counterpart, Calling one of these synchronous methods could potentially block the current thread for a large amount of time, since it might be fetching from network or saving/loading data from disk.

  • Returns a PFObject with a given class and id.

    Declaration

    Objective-C

    + (nullable PFGenericObject)getObjectOfClass:(nonnull NSString *)objectClass
                                        objectId:(nonnull NSString *)objectId;

    Parameters

    objectClass

    The class name for the object that is being requested.

    objectId

    The id of the object that is being requested.

    Return Value

    The PFObject if found. Returns nil if the object isn’t found, or if there was an error.

  • Returns a PFObject with a given class and id and sets an error if necessary.

    Declaration

    Objective-C

    + (nullable PFGenericObject)getObjectOfClass:(nonnull NSString *)objectClass
                                        objectId:(nonnull NSString *)objectId
                                           error:
                                               (NSError *_Nullable *_Nullable)error;

    Parameters

    objectClass

    The class name for the object that is being requested.

    objectId

    The id of the object that is being requested.

    error

    Pointer to an NSError that will be set if necessary.

    Return Value

    The PFObject if found. Returns nil if the object isn’t found, or if there was an error.

  • Returns a PFObject with the given id.

    Warning

    This method mutates the query. It will reset limit to 1, skip to 0 and remove all conditions, leaving only objectId.

    Declaration

    Objective-C

    - (nullable PFGenericObject)getObjectWithId:(nonnull NSString *)objectId;

    Parameters

    objectId

    The id of the object that is being requested.

    Return Value

    The PFObject if found. Returns nil if the object isn’t found, or if there was an error.

  • Returns a PFObject with the given id and sets an error if necessary.

    Warning

    This method mutates the query. It will reset limit to 1, skip to 0 and remove all conditions, leaving only objectId.

    Declaration

    Objective-C

    - (nullable PFGenericObject)getObjectWithId:(nonnull NSString *)objectId
                                          error:
                                              (NSError *_Nullable *_Nullable)error;

    Parameters

    objectId

    The id of the object that is being requested.

    error

    Pointer to an NSError that will be set if necessary.

    Return Value

    The PFObject if found. Returns nil if the object isn’t found, or if there was an error.

  • Returns a PFUser with a given id.

    Declaration

    Objective-C

    + (nullable PFUser *)getUserObjectWithId:(nonnull NSString *)objectId;

    Parameters

    objectId

    The id of the object that is being requested.

    Return Value

    The PFUser if found. Returns nil if the object isn’t found, or if there was an error.

  • Returns a PFUser with a given class and id and sets an error if necessary. - parameter: objectId The id of the object that is being requested. - parameter: error Pointer to an NSError that will be set if necessary. @result The PFUser if found. Returns nil if the object isn’t found, or if there was an error.

    Declaration

    Objective-C

    + (nullable PFUser *)getUserObjectWithId:(nonnull NSString *)objectId
                                       error:(NSError *_Nullable *_Nullable)error;

    Parameters

    objectId

    The id of the object that is being requested.

    error

    Pointer to an NSError that will be set if necessary.

  • Finds objects synchronously based on the constructed query.

    Declaration

    Objective-C

    - (nullable NSArray<PFGenericObject> *)findObjects;

    Return Value

    Returns an array of PFObject objects that were found.

  • Finds objects synchronously based on the constructed query and sets an error if there was one.

    Declaration

    Objective-C

    - (nullable NSArray<PFGenericObject> *)findObjects:
            (NSError *_Nullable *_Nullable)error;

    Parameters

    error

    Pointer to an NSError that will be set if necessary.

    Return Value

    Returns an array of PFObject objects that were found.

  • Gets an object synchronously based on the constructed query.

    Warning

    This method mutates the query. It will reset the limit to 1.

    Declaration

    Objective-C

    - (nullable PFGenericObject)getFirstObject;

    Return Value

    Returns a PFObject, or nil if none was found.

  • Gets an object synchronously based on the constructed query and sets an error if any occurred.

    Warning

    This method mutates the query. It will reset the limit to 1.

    Declaration

    Objective-C

    - (nullable PFGenericObject)getFirstObject:(NSError *_Nullable *_Nullable)error;

    Parameters

    error

    Pointer to an NSError that will be set if necessary.

    Return Value

    Returns a PFObject, or nil if none was found.

  • Counts objects synchronously based on the constructed query.

    Declaration

    Objective-C

    - (NSInteger)countObjects;

    Return Value

    Returns the number of PFObject objects that match the query, or -1 if there is an error.

  • Counts objects synchronously based on the constructed query and sets an error if there was one.

    Declaration

    Objective-C

    - (NSInteger)countObjects:(NSError *_Nullable *_Nullable)error;

    Parameters

    error

    Pointer to an NSError that will be set if necessary.

    Return Value

    Returns the number of PFObject objects that match the query, or -1 if there is an error.