Instance Method インスタンスメソッド

runMode:beforeDate:

Runs the loop once, blocking for input in the specified mode until a given date. ループを一度だけ走らせます、与えられた日付までこの指定されたモードにおいて入力に対して遮断します。

Declaration 宣言

- (BOOL)runMode:(NSRunLoopMode)mode 
     beforeDate:(NSDate *)limitDate;

Parameters パラメータ

mode

The mode in which to run. このモードで実行することになります。 You may specify custom modes or use one of the modes listed in Run Loop Modes.

limitDate

The date until which to block. この日付まで遮断することになります。

Return Value 戻り値

YES if the run loop ran and processed an input source or if the specified timeout value was reached; otherwise, NO if the run loop could not be started. YES、もし実行ループが動作したそして入力ソースを処理したならばまたはもし指定された時間切り値が到達されたならば;そうでなければ、もし実行ループが開始されることができなかったならばNO

Discussion 議論

If no input sources or timers are attached to the run loop, this method exits immediately and returns NO; otherwise, it returns after either the first input source is processed or limitDate is reached. Manually removing all known input sources and timers from the run loop does not guarantee that the run loop will exit immediately. macOS may install and remove additional input sources as needed to process requests targeted at the receiver’s thread. Those sources could therefore prevent the run loop from exiting. 入力ソースまたはタイマーが実行ループに添付されないならば、このメソッドは直ちに退出してNOを返します;そうでなければ、それは最初の入力ソースが処理されたかまたはlimitDateに到達したかのどちらかの後に返ります。全ての既知の入力ソースとタイマーを実行ループから手動で取り除くことは、実行ループが直ちに退出することを保証しません。macOSは、追加の入力ソースを必要に応じてインストールおよび除去して、レシーバのもつスレッドで目標とされる要請それらを処理するかもしれません。これらのソースは、従って実行ループが退出することを妨げます。

See Also 参照

Running a Loop ループを実行する