Type Method 型メソッド

discreteProgressWithTotalUnitCount:

Creates and returns a progress instance with the specified unit count that isn’t part of any existing progress tree. ある進捗インスタンスをこの指定された単位計数で作成して返します、それはどんな既存の進捗ツリーの一部でもありません。

Declaration 宣言

+ (NSProgress *)discreteProgressWithTotalUnitCount:(int64_t)unitCount;

Parameters パラメータ

unitCount

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

Return Value 戻り値

A new progress instance with its containing progress object set to nil.

Discussion 議論

Use this method to create the top-level progress object that your custom classes return. The receiver of the returned progress object can add it to a progress tree using addChild:withPendingUnitCount:.

You’re responsible for updating the progress count of the created progress object. 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. あなたは、このメソッドを一方のメソッド上で発動して、それから返されるNSProgressを別のスレッド上に通信によって(メッセージで)伝えられます。例えば、あなたは作成された進捗インスタンスを、あなたが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 進捗オブジェクトを作成する