Instance Method

waitForDataInBackgroundAndNotifyForModes:

Asynchronously checks to see if data is available.

Declaration

- (void)waitForDataInBackgroundAndNotifyForModes:(NSArray<NSRunLoopMode> *)modes;

Parameters

modes

The runloop modes in which the data available notification can be posted.

Discussion

When the data becomes available, this method posts a NSFileHandleDataAvailableNotification notification on the current thread. This method differs from waitForDataInBackgroundAndNotify in that modes specifies the run-loop mode (or modes) in which NSFileHandleDataAvailableNotification can be posted.

You must call this method from a thread that has an active run loop.

See Also

Communicating Asynchronously

- acceptConnectionInBackgroundAndNotify

Accepts a socket connection (for stream-type sockets only) in the background and creates a file handle for the “near” (client) end of the communications channel.

- acceptConnectionInBackgroundAndNotifyForModes:

Accepts a socket connection (for stream-type sockets only) in the background and creates a file handle for the “near” (client) end of the communications channel.

- readInBackgroundAndNotify

Reads from the file or communications channel in the background and posts a notification when finished.

- readInBackgroundAndNotifyForModes:

Reads from the file or communications channel in the background and posts a notification when finished.

- readToEndOfFileInBackgroundAndNotify

Reads to the end of file from the file or communications channel in the background and posts a notification when finished.

- readToEndOfFileInBackgroundAndNotifyForModes:

Reads to the end of file from the file or communications channel in the background and posts a notification when finished.

- waitForDataInBackgroundAndNotify

Asynchronously checks to see if data is available.