Instance Property インスタンスプロパティ

progress

An object that represents the total progress of the operations executing in the queue.

Declaration 宣言

@property(readonly, strong) NSProgress *progress;

Discussion 議論

By default, NSOperationQueue doesn’t report progress until totalUnitCount is set. When totalUnitCount is set, the queue begins reporting progress. Each operation in the queue contributes one unit of completion to the overall progress of the queue for operations that are finished by the end of main. Operations that override start and don’t invoke super don’t contribute to the queue’s progress.

To update totalUnitCount in a thread-safe manner, use the addBarrierBlock: method. This method ensures that the operation queue completes the operations in the queue, preventing an inadvertent backward jump in progress.