PFFile(Synchronous)

@interface PFFile (Synchronous)

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

  • Saves the file synchronously.

    Declaration

    Objective-C

    - (BOOL)save;

    Return Value

    Returns whether the save succeeded.

  • Saves the file synchronously 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.

  • Whether the data is available in memory or needs to be downloaded.

    Declaration

    Objective-C

    @property (readonly, getter=isDataAvailable, assign, nonatomic)
        BOOL dataAvailable;
  • Synchronously gets the data from cache if available or fetches its contents from the network.

    Declaration

    Objective-C

    - (nullable NSData *)getData;

    Return Value

    The NSData object containing file data. Returns nil if there was an error in fetching.

  • Synchronously gets the data from cache if available or fetches its contents from the network. Sets an error if it occurs.

    Declaration

    Objective-C

    - (nullable NSData *)getData:(NSError *_Nullable *_Nullable)error;

    Parameters

    error

    Pointer to an NSError that will be set if necessary.

    Return Value

    The NSData object containing file data. Returns nil if there was an error in fetching.

  • This method is like -getData but avoids ever holding the entire PFFile contents in memory at once.

    This can help applications with many large files avoid memory warnings.

    Declaration

    Objective-C

    - (nullable NSInputStream *)getDataStream;

    Return Value

    A stream containing the data. Returns nil if there was an error in fetching.

  • This method is like -getData but avoids ever holding the entire PFFile contents in memory at once.

    Declaration

    Objective-C

    - (nullable NSInputStream *)getDataStream:(NSError *_Nullable *_Nullable)error;

    Parameters

    error

    Pointer to an NSError that will be set if necessary.

    Return Value

    A stream containing the data. Returns nil if there was an error in fetching.