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

waitForDataInBackgroundAndNotify(forModes:)

Asynchronously checks to see if data is available. データが利用可能かどうかを知るために非同期的に調べます。

Declaration 宣言

func waitForDataInBackgroundAndNotify(forModes modes: [RunLoop.Mode]?)

Parameters パラメータ

modes

The runloop modes in which the data available notification can be posted. そこにおいてデータ利用可能通知が投函されることができる実行ループモード

Discussion 議論

When the data becomes available, this method posts a NSFileHandleDataAvailable notification on the current thread. This method differs from waitForDataInBackgroundAndNotify() in that modes specifies the run-loop mode (or modes) in which NSFileHandleDataAvailable can be posted. データが利用可能になる場合、このメソッドはNSFileHandleDataAvailable通知を現在のスレッド上で投函します。このメソッドは、waitForDataInBackgroundAndNotify()とは、modesがそこにおいてNSFileHandleDataAvailableが投函されることが可能な実行ループモード(または複数のモード)を指定することにおいて異なります。

You must call this method from a thread that has an active run loop. あなたは、このメソッドをアクティブ実行ループを持つスレッドから呼び出さなければなりません。

See Also 参照

Reading Asynchronously with Notifications 通知で非同期に読み出す