MBFileReadOperationDelegate Protocol Reference

Declared in MBFilesystemOperations.h

Overview

This protocol is adopted by classes that wish to be notified about the completion status of MBFileReadOperations.

Note: Delegate methods will always be called on the main thread.

– readCompletedWithObject:forOperation: required method

Called when an MBFileReadOperation completes successfully.

- (void)readCompletedWithObject:(nonnull id)readObj forOperation:(nonnull MBFileReadOperation *)op

Parameters

readObj

The object that was read from the filesystem. Typically, this is an NSData object containing the byte data of the file. However, MBFileReadOperation subclasses are free to construct any type of object. For example, an implementation for an image cache may pass UIImage instances.

op

The operation that completed.

Declared In

MBFilesystemOperations.h

– readFailedWithError:forOperation: required method

Called when an MBFileReadOperation fails.

- (void)readFailedWithError:(nonnull NSError *)err forOperation:(nonnull MBFileReadOperation *)op

Parameters

err

An NSError instance describing the error that occurred.

op

The operation that failed.

Declared In

MBFilesystemOperations.h