Type Method 型メソッド

progressWithTotalUnitCount:parent:pendingUnitCount:

Creates a progress instance for the specified progress object with a unit count that’s a portion of the containing object’s total unit count. ある進捗インスタンスをこの指定された進捗オブジェクトに対してある単位計数で作成します、それはその包含オブジェクトのもつ総単位計数の一部です。

Declaration 宣言

+ (NSProgress *)progressWithTotalUnitCount:(int64_t)unitCount 
                                    parent:(NSProgress *)parent 
                          pendingUnitCount:(int64_t)portionOfParentTotalUnitCount;

Parameters パラメータ

unitCount

The total number of units of work to assign to the progress instance.

Parent

The containing progress object for the created NSProgress object.

portionOfParentTotalUnitCount

The unit count for the progress object. この進捗オブジェクトのための単位計数。

Discussion 議論

Use this method to initialize a progress object with a specified containing progress object and unit count.

In many cases, you can precede code that does a substantial amount of work with an invocation of this method, then repeatedly set the completedUnitCount or cancelled property in the loop that does the work.

You can invoke this method on one thread and then message the returned NSProgress on another thread. For example, you can capture the created progress instance in a block that you pass to dispatch_async. In that block, you can invoke methods like becomeCurrentWithPendingUnitCount: or resignCurrent, and set the completedUnitCount or cancelled properties as your app finishes its work.

See Also 参照

Creating Progress Objects 進捗オブジェクトを作成する