PFObject(Synchronous)

@interface PFObject (Synchronous)

This category lists all methods of PFObject 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.

  • Synchronously saves the PFObject.

    Declaration

    Objective-C

    - (BOOL)save;

    Return Value

    Returns whether the save succeeded.

  • Synchronously saves the PFObject and sets an error if it occurs.

    Declaration

    Objective-C

    - (BOOL)save:(NSError *_Nullable *_Nullable)error;

    Parameters

    error

    Pointer to an NSError that will be set if necessary.

    Return Value

    Returns whether the save succeeded.

  • Saves a collection of objects *synchronously all at once.

    Declaration

    Objective-C

    + (BOOL)saveAll:(nullable NSArray<PFObject *> *)objects;

    Parameters

    objects

    The array of objects to save.

    Return Value

    Returns whether the save succeeded.

  • Saves a collection of objects synchronously all at once and sets an error if necessary.

    Declaration

    Objective-C

    + (BOOL)saveAll:(nullable NSArray<PFObject *> *)objects
              error:(NSError *_Nullable *_Nullable)error;

    Parameters

    objects

    The array of objects to save.

    error

    Pointer to an NSError that will be set if necessary.

    Return Value

    Returns whether the save succeeded.

  • Synchronously* fetches the PFObject with the current data from the server.

    Declaration

    Objective-C

    - (nullable instancetype)fetch;
  • Synchronously fetches the PFObject with the current data from the server and sets an error if it occurs.

    Declaration

    Objective-C

    - (nullable instancetype)fetch:(NSError *_Nullable *_Nullable)error;

    Parameters

    error

    Pointer to an NSError that will be set if necessary.

  • Synchronously* fetches the PFObject data from the server if dataAvailable is NO.

    Declaration

    Objective-C

    - (nullable instancetype)fetchIfNeeded;
  • Synchronously fetches the PFObject data from the server if dataAvailable is NO.

    Declaration

    Objective-C

    - (nullable instancetype)fetchIfNeeded:(NSError *_Nullable *_Nullable)error;

    Parameters

    error

    Pointer to an NSError that will be set if necessary.

  • Synchronously fetches all of the PFObject objects with the current data from the server.

    Declaration

    Objective-C

    + (nullable NSArray<__kindof PFObject *> *)fetchAll:
            (nullable NSArray<PFObject *> *)objects;

    Parameters

    objects

    The list of objects to fetch.

  • Synchronously fetches all of the PFObject objects with the current data from the server and sets an error if it occurs.

    Declaration

    Objective-C

    + (nullable NSArray<__kindof PFObject *> *)
        fetchAll:(nullable NSArray<PFObject *> *)objects
           error:(NSError *_Nullable *_Nullable)error;

    Parameters

    objects

    The list of objects to fetch.

    error

    Pointer to an NSError that will be set if necessary.

  • Synchronously fetches all of the PFObject objects with the current data from the server. - parameter: objects The list of objects to fetch.

    Declaration

    Objective-C

    + (nullable NSArray<__kindof PFObject *> *)fetchAllIfNeeded:
            (nullable NSArray<PFObject *> *)objects;

    Parameters

    objects

    The list of objects to fetch.

  • Synchronously fetches all of the PFObject objects with the current data from the server and sets an error if it occurs.

    Declaration

    Objective-C

    + (nullable NSArray<__kindof PFObject *> *)
        fetchAllIfNeeded:(nullable NSArray<PFObject *> *)objects
                   error:(NSError *_Nullable *_Nullable)error;

    Parameters

    objects

    The list of objects to fetch.

    error

    Pointer to an NSError that will be set if necessary.

  • Synchronously loads data from the local datastore into this object, if it has not been fetched from the server already.

    Declaration

    Objective-C

    - (nullable instancetype)fetchFromLocalDatastore;
  • Synchronously loads data from the local datastore into this object, if it has not been fetched from the server already.

    If the object is not stored in the local datastore, this error will be set to return kPFErrorCacheMiss.

    Declaration

    Objective-C

    - (nullable instancetype)fetchFromLocalDatastore:
            (NSError *_Nullable *_Nullable)error;

    Parameters

    error

    Pointer to an NSError that will be set if necessary.

  • Synchronously deletes the PFObject.

    Declaration

    Objective-C

    - (BOOL) delete;

    Return Value

    Returns whether the delete succeeded.

  • Synchronously deletes the PFObject and sets an error if it occurs.

    Declaration

    Objective-C

    - (BOOL) delete:(NSError *_Nullable *_Nullable)error;

    Parameters

    error

    Pointer to an NSError that will be set if necessary.

    Return Value

    Returns whether the delete succeeded.

  • Synchronously deletes a collection of objects all at once.

    Declaration

    Objective-C

    + (BOOL)deleteAll:(nullable NSArray<PFObject *> *)objects;

    Parameters

    objects

    The array of objects to delete.

    Return Value

    Returns whether the delete succeeded.

  • Synchronously deletes a collection of objects all at once and sets an error if necessary.

    Declaration

    Objective-C

    + (BOOL)deleteAll:(nullable NSArray<PFObject *> *)objects
                error:(NSError *_Nullable *_Nullable)error;

    Parameters

    objects

    The array of objects to delete.

    error

    Pointer to an NSError that will be set if necessary.

    Return Value

    Returns whether the delete succeeded.

  • Synchronously stores the object and every object it points to in the local datastore, recursively, using a default pin name: PFObjectDefaultPin.

    If those other objects have not been fetched from Parse, they will not be stored. However, if they have changed data, all the changes will be retained. To get the objects back later, you can use a PFQuery that uses PFQuery.-fromLocalDatastore, or you can create an unfetched pointer with +objectWithoutDataWithClassName:objectId: and then call -fetchFromLocalDatastore on it.

    See

    -unpin:

    Declaration

    Objective-C

    - (BOOL)pin;

    Return Value

    Returns whether the pin succeeded.

  • Synchronously stores the object and every object it points to in the local datastore, recursively, using a default pin name: PFObjectDefaultPin.

    If those other objects have not been fetched from Parse, they will not be stored. However, if they have changed data, all the changes will be retained. To get the objects back later, you can use a PFQuery that uses PFQuery.-fromLocalDatastore, or you can create an unfetched pointer with +objectWithoutDataWithClassName:objectId: and then call -fetchFromLocalDatastore on it.

    See

    -unpin:

    Declaration

    Objective-C

    - (BOOL)pin:(NSError *_Nullable *_Nullable)error;

    Parameters

    error

    Pointer to an NSError that will be set if necessary.

    Return Value

    Returns whether the pin succeeded.

  • Synchronously stores the object and every object it points to in the local datastore, recursively.

    If those other objects have not been fetched from Parse, they will not be stored. However, if they have changed data, all the changes will be retained. To get the objects back later, you can use a PFQuery that uses PFQuery.-fromLocalDatastore, or you can create an unfetched pointer with +objectWithoutDataWithClassName:objectId: and then call -fetchFromLocalDatastore on it.

    Declaration

    Objective-C

    - (BOOL)pinWithName:(nonnull NSString *)name;

    Parameters

    name

    The name of the pin.

    Return Value

    Returns whether the pin succeeded.

  • Synchronously stores the object and every object it points to in the local datastore, recursively.

    If those other objects have not been fetched from Parse, they will not be stored. However, if they have changed data, all the changes will be retained. To get the objects back later, you can use a PFQuery that uses PFQuery.-fromLocalDatastore, or you can create an unfetched pointer with +objectWithoutDataWithClassName:objectId: and then call -fetchFromLocalDatastore on it.

    Declaration

    Objective-C

    - (BOOL)pinWithName:(nonnull NSString *)name
                  error:(NSError *_Nullable *_Nullable)error;

    Parameters

    name

    The name of the pin.

    error

    Pointer to an NSError that will be set if necessary.

    Return Value

    Returns whether the pin succeeded.

  • Synchronously stores the objects and every object they point to in the local datastore, recursively, using a default pin name: PFObjectDefaultPin.

    If those other objects have not been fetched from Parse, they will not be stored. However, if they have changed data, all the changes will be retained. To get the objects back later, you can use a PFQuery that uses PFQuery.-fromLocalDatastore, or you can create an unfetched pointer with +objectWithoutDataWithClassName:objectId: and then call fetchFromLocalDatastore: on it.

    See

    unpinAll:

    See

    PFObjectDefaultPin

    Declaration

    Objective-C

    + (BOOL)pinAll:(nullable NSArray<PFObject *> *)objects;

    Parameters

    objects

    The objects to be pinned.

    Return Value

    Returns whether the pin succeeded.

  • Synchronously stores the objects and every object they point to in the local datastore, recursively, using a default pin name: PFObjectDefaultPin.

    If those other objects have not been fetched from Parse, they will not be stored. However, if they have changed data, all the changes will be retained. To get the objects back later, you can use a PFQuery that uses PFQuery.-fromLocalDatastore, or you can create an unfetched pointer with +objectWithoutDataWithClassName:objectId: and then call fetchFromLocalDatastore: on it.

    See

    unpinAll:error:

    See

    PFObjectDefaultPin

    Declaration

    Objective-C

    + (BOOL)pinAll:(nullable NSArray<PFObject *> *)objects
             error:(NSError *_Nullable *_Nullable)error;

    Parameters

    objects

    The objects to be pinned.

    error

    Pointer to an NSError that will be set if necessary.

    Return Value

    Returns whether the pin succeeded.

  • Synchronously stores the objects and every object they point to in the local datastore, recursively.

    If those other objects have not been fetched from Parse, they will not be stored. However, if they have changed data, all the changes will be retained. To get the objects back later, you can use a PFQuery that uses PFQuery.-fromLocalDatastore, or you can create an unfetched pointer with +objectWithoutDataWithClassName:objectId: and then call fetchFromLocalDatastore: on it.

    See

    unpinAll:withName:

    Declaration

    Objective-C

    + (BOOL)pinAll:(nullable NSArray<PFObject *> *)objects
          withName:(nonnull NSString *)name;

    Parameters

    objects

    The objects to be pinned.

    name

    The name of the pin.

    Return Value

    Returns whether the pin succeeded.

  • Synchronously stores the objects and every object they point to in the local datastore, recursively.

    If those other objects have not been fetched from Parse, they will not be stored. However, if they have changed data, all the changes will be retained. To get the objects back later, you can use a PFQuery that uses PFQuery.-fromLocalDatastore, or you can create an unfetched pointer with +objectWithoutDataWithClassName:objectId: and then call fetchFromLocalDatastore: on it.

    See

    unpinAll:withName:error:

    Declaration

    Objective-C

    + (BOOL)pinAll:(nullable NSArray<PFObject *> *)objects
          withName:(nonnull NSString *)name
             error:(NSError *_Nullable *_Nullable)error;

    Parameters

    objects

    The objects to be pinned.

    name

    The name of the pin.

    error

    Pointer to an NSError that will be set if necessary.

    Return Value

    Returns whether the pin succeeded.

  • Synchronously removes the object and every object it points to in the local datastore, recursively, using a default pin name: PFObjectDefaultPin.

    See

    pin:

    See

    PFObjectDefaultPin

    Declaration

    Objective-C

    - (BOOL)unpin;

    Return Value

    Returns whether the unpin succeeded.

  • Synchronously removes the object and every object it points to in the local datastore, recursively, using a default pin name: PFObjectDefaultPin.

    See

    pin:

    See

    PFObjectDefaultPin

    Declaration

    Objective-C

    - (BOOL)unpin:(NSError *_Nullable *_Nullable)error;

    Parameters

    error

    Pointer to an NSError that will be set if necessary.

    Return Value

    Returns whether the unpin succeeded.

  • Synchronously removes the object and every object it points to in the local datastore, recursively.

    See

    pinWithName:

    Declaration

    Objective-C

    - (BOOL)unpinWithName:(nonnull NSString *)name;

    Parameters

    name

    The name of the pin.

    Return Value

    Returns whether the unpin succeeded.

  • Synchronously removes the object and every object it points to in the local datastore, recursively.

    See

    pinWithName:error:

    Declaration

    Objective-C

    - (BOOL)unpinWithName:(nonnull NSString *)name
                    error:(NSError *_Nullable *_Nullable)error;

    Parameters

    name

    The name of the pin.

    error

    Pointer to an NSError that will be set if necessary.

    Return Value

    Returns whether the unpin succeeded.

  • Synchronously removes all objects in the local datastore using a default pin name: PFObjectDefaultPin.

    See

    PFObjectDefaultPin

    Declaration

    Objective-C

    + (BOOL)unpinAllObjects;

    Return Value

    Returns whether the unpin succeeded.

  • Synchronously removes all objects in the local datastore using a default pin name: PFObjectDefaultPin.

    See

    PFObjectDefaultPin

    Declaration

    Objective-C

    + (BOOL)unpinAllObjects:(NSError *_Nullable *_Nullable)error;

    Parameters

    error

    Pointer to an NSError that will be set if necessary.

    Return Value

    Returns whether the unpin succeeded.

  • Synchronously removes all objects with the specified pin name.

    Declaration

    Objective-C

    + (BOOL)unpinAllObjectsWithName:(nonnull NSString *)name;

    Parameters

    name

    The name of the pin.

    Return Value

    Returns whether the unpin succeeded.

  • Synchronously removes all objects with the specified pin name.

    Declaration

    Objective-C

    + (BOOL)unpinAllObjectsWithName:(nonnull NSString *)name
                              error:(NSError *_Nullable *_Nullable)error;

    Parameters

    name

    The name of the pin.

    error

    Pointer to an NSError that will be set if necessary.

    Return Value

    Returns whether the unpin succeeded.

  • Synchronously removes the objects and every object they point to in the local datastore, recursively, using a default pin name: PFObjectDefaultPin.

    See

    pinAll:

    See

    PFObjectDefaultPin

    Declaration

    Objective-C

    + (BOOL)unpinAll:(nullable NSArray<PFObject *> *)objects;

    Parameters

    objects

    The objects.

    Return Value

    Returns whether the unpin succeeded.

  • Synchronously removes the objects and every object they point to in the local datastore, recursively, using a default pin name: PFObjectDefaultPin.

    See

    pinAll:error:

    See

    PFObjectDefaultPin

    Declaration

    Objective-C

    + (BOOL)unpinAll:(nullable NSArray<PFObject *> *)objects
               error:(NSError *_Nullable *_Nullable)error;

    Parameters

    objects

    The objects.

    error

    Pointer to an NSError that will be set if necessary.

    Return Value

    Returns whether the unpin succeeded.

  • Synchronously removes the objects and every object they point to in the local datastore, recursively.

    See

    pinAll:withName:

    Declaration

    Objective-C

    + (BOOL)unpinAll:(nullable NSArray<PFObject *> *)objects
            withName:(nonnull NSString *)name;

    Parameters

    objects

    The objects.

    name

    The name of the pin.

    Return Value

    Returns whether the unpin succeeded.

  • Synchronously removes the objects and every object they point to in the local datastore, recursively.

    See

    pinAll:withName:error:

    Declaration

    Objective-C

    + (BOOL)unpinAll:(nullable NSArray<PFObject *> *)objects
            withName:(nonnull NSString *)name
               error:(NSError *_Nullable *_Nullable)error;

    Parameters

    objects

    The objects.

    name

    The name of the pin.

    error

    Pointer to an NSError that will be set if necessary.

    Return Value

    Returns whether the unpin succeeded.